IP Library Granted Patent US 12,488,199
Granted Patent B2
US 12,488,199 · App. 18/531,012 · Granted Dec 2, 2025

Prompt discovery with attention refinement

Inventors: Aaron K. Baughman (Cary, NC); Kavitha Hassan Yogaraj (Bangalore, IN); Amit Kumar Raha (Barrackpore, IN); Christian Eggenberger-Wang (Wil, CH)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F40/40G06F40/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,488,199
App. No.
18/531,012
Granted
Dec 2, 2025
Kind
B2
Abstract

An embodiment senses a sequence, responsive to the sensed sequence, segments the sensed sequence into a prompt and text. The embodiment generates an attention embedding representative of the text and computes an attention weight based on the attention embedding. The embodiment generates a prompt embedding representative of the prompt. The embodiment computes a relationship between the prompt embedding and the attention weight comprising correlating the attention embedding and the attention weight based on a beam search; bin packing the prompt embedding where a bin is defined by the attention embedding; matching the prompt embedding to the bin based on a Minkowski distance metric; where the bin packing causes the computing of the relationship between the prompt and the text represented by the attention weight.

Claims (41)

1 . A computer-implemented method comprising:

sensing a sequence; responsive to the sensed sequence, segmenting the sensed sequence into a prompt and text;

generating an attention embedding representative of the text and computing an attention weight based on the attention embedding;

generating a prompt embedding representative of the prompt; and

computing a relationship between the prompt embedding and the attention weight comprising:

correlating the attention embedding and the attention weight based on a beam search;

bin packing the prompt embedding wherein a bin is defined by the attention embedding; and

matching the prompt embedding to the bin based on a Minkowski distance metric; wherein the bin packing causes the computing of the relationship between the prompt and the text represented by the attention weight.

2 . The computer-implemented method of claim 1 , wherein the bin is defined by a dimension of the attention embedding.

3 . The computer-implemented method of claim 1 , wherein computing the attention weight is based on a 5W framework, the 5W framework comprising of what, where, when, why and who questions.

4 . The computer-implemented method of claim 1 , wherein the segmenting comprises zero-shot, one-shot, and few-shot learning.

5 . The computer-implemented method of claim 1 , wherein a Minkowski distance metric p value comprises of 1, 2, or 3.

6 . The computer-implemented method of claim 1 , wherein the correlating comprises selecting a highest R-squared value.

7 . The computer-implemented method of claim 1 , wherein the segmenting the sensed sequence further comprises segmenting the sensed sequence into a context wherein the context determines the attention embedding representative of the text.

8 . A computer program product comprising one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by a processor to cause the processor to perform operations comprising:

sensing a sequence; responsive to the sensed sequence, segmenting the sensed sequence into a prompt and text;

generating an attention embedding representative of the text and computing an attention weight based on the attention embedding;

generating a prompt embedding representative of the prompt; and

computing a relationship between the prompt embedding and the attention weight comprising:

correlating the attention embedding and the attention weight based on a beam search;

bin packing the prompt embedding wherein a bin is defined by the attention embedding; and

matching the prompt embedding to the bin based on a Minkowski distance metric; wherein the bin packing causes the computing of the relationship between the prompt and the text represented by the attention weight.

9 . The computer program product of claim 8 , wherein the bin is defined by a dimension of the attention embedding.

10 . The computer program product of claim 8 , wherein computing the attention weight is based on a 5W framework, the 5W framework comprising of what, where, when, why and who questions.

11 . The computer program product of claim 8 , wherein the segmenting comprises zero-shot, one-shot, and few-shot learning.

12 . The computer program product of claim 8 , wherein a Minkowski distance metric p value comprises of 1, 2, or 3.

13 . The computer program product of claim 8 , wherein the correlating comprises selecting a highest R-squared value.

14 . The computer program product of claim 8 , wherein the segmenting the sensed sequence further comprises segmenting the sensed sequence into a context wherein the context determines the attention embedding representative of the text.

15 . A computer system comprising a processor and one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable by the processor to cause the processor to perform operations comprising:

sensing a sequence; responsive to the sensed sequence, segmenting the sensed sequence into a prompt and text;

generating an attention embedding representative of the text and computing an attention weight based on the attention embedding;

generating a prompt embedding representative of the prompt; and

computing a relationship between the prompt embedding and the attention weight comprising:

correlating the attention embedding and the attention weight based on a beam search;

bin packing the prompt embedding wherein a bin is defined by the attention embedding; and

matching the prompt embedding to the bin based on a Minkowski distance metric; wherein the bin packing causes the computing of the relationship between the prompt and the text represented by the attention weight.

16 . The computer system of claim 15 , wherein the bin is defined by a dimension of the attention embedding.

17 . The computer system of claim 15 , wherein computing the attention weight is based on a 5W framework, the 5W framework comprising of what, where, when, why and who questions.

18 . The computer system of claim 15 , wherein the segmenting comprises zero-shot, one-shot, and few-shot learning.

19 . The computer system of claim 15 , wherein a Minkowski distance metric p value comprises of 1, 2, or 3.

20 . The computer system of claim 15 , wherein the segmenting the sensed sequence further comprises segmenting the sensed sequence into a context wherein the context determines the attention embedding representative of the text.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 6, 2023
From: BAUGHMAN, AARON K.; YOGARAJ, KAVITHA HASSAN; RAHA, AMIT KUMAR; EGGENBERGER-WANG, CHRISTIAN -
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 065785/0001 →
Continuity (1)
Related Publication 20250190709A1 · Jun 12, 2025
References Cited (43)
US 8265925B2 · Aarskog · 2012 [cited by examiner]
US 8977558B2 · Nielsen · 2015 [cited by examiner]
US 11238239B2 · Liu · 2022 [cited by examiner]
US 11348269B1 · Ebrahimi Afrouzi · 2022 [cited by examiner]
US 11443120B2 · Poddar · 2022 [cited by examiner]
US 11481918B1 · Ebrahimi Afrouzi · 2022 [cited by examiner]
US 11657531B1 · Ebrahimi Afrouzi · 2023 [cited by examiner]
US 11688021B2 · Penov · 2023 [cited by examiner]
US 11704745B2 · Poddar · 2023 [cited by examiner]
US 11961252B1 · Ebrahimi Afrouzi · 2024 [cited by examiner]
US 12094145B2 · Ebrahimi Afrouzi · 2024 [cited by examiner]
US 12182883B2 · Liu · 2024 [cited by examiner]
US 20050108001A1 · Aarskog · 2005 [cited by examiner]
US 20200073937A1 · Zhao · 2020 [cited by examiner]
US 20200134422A1 · Gliozzo · 2020 [cited by examiner]
US 20200356628A1 · An · 2020 [cited by examiner]
US 20210271823A1 · De Ridder · 2021 [cited by examiner]
US 20220036153A1 · O'Malia · 2022 [cited by examiner]
US 20220415320A1 · Zheng · 2022 [cited by examiner]
US 20230076095A1 · Peng · 2023 [cited by examiner]
US 20230104662A1 · Fatemi · 2023 [cited by examiner]
US 20240119614A1 · Ebrahimi Afrouzi · 2024 [cited by examiner]
US 20240193973A1 · Song · 2024 [cited by examiner]
US 20250190709A1 · Baughman · 2025 [cited by examiner]
CN 112487786A · 2021 [cited by applicant]
WO 2021047286A1 · 2021 [cited by applicant]
Jernite et al., Data Governance in the Age of Large-Scale Data-Driven Language Technology, FAccT '22: Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, pp. 2206-2222, Jun. 20, 2022. [cited by applicant]
Volkovs et al., Predicting Twitter Engagement with Deep Language Models, RecSysChallenge '20: Proceedings of the Recommender Systems Challenge 2020, pp. 38-43, Sep. 26, 2020. [cited by applicant]
Bao et al., HHH: An Online Medical Chatbot System based on Knowledge Graph and Hierarchical Bi-Directional Attention, ACSW '20: Proceedings of the Australasian Computer Science Week Multiconference, pp. 1-10, Feb. 8, 20… [cited by applicant]
Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, Apr. 12, 2021. [cited by applicant]
Chowdhery et al., PaLM: Scaling Language Modeling with Pathways, Oct. 5, 2022. [cited by applicant]
Huang et al., Language is Not All You Need: Aligning Perception with Language Models, Mar. 1, 2023. [cited by applicant]
Storrs, Explained: Multi-head Attention (Part 1), Aug. 7, 2021, https://storrs.io/attention/. [cited by applicant]
Tamura, Multi-head attention mechanism: “queries”, “keys”, and “values,” over and over again, Apr. 7, 2021, https://data-science-blog.com/blog/2021/04/07/multi-head-attention-mechanism/. [cited by applicant]
Tiu, Understanding Zero-Shot Learning Making ML More Human, Jun. 24, 2021, https://towardsdatascience.com/understanding-zero-shot-learning-making-ml-more-human-4653ac35ccab. [cited by applicant]
You et al., TI-Prompt: Towards a Prompt Tuning Method for Few-shot Threat Intelligence Twitter Classification, 2022 IEEE 46th Annual Computers, Software, and Applications Conference (COMPSAC), pp. 272-279, 2022. [cited by applicant]
Seo et al., Plain Template Insertion: Korean-Prompt-Based Engineering for Few-Shot Learners, Oct. 10, 2022. [cited by applicant]
Li et al., PTS: A Prompt-based Teacher-Student Network for Weakly Supervised Aspect Detection, 2022 International Joint Conference on Neural Networks (IJCNN), Jul. 18-23, 2022. [cited by applicant]
Grosse et al., CSC421/2516 Lecture 16: Attention, 2023. [cited by applicant]
Kim et al., Intention Estimation and Recommendation System Based on Attention Sharing, 2013. [cited by applicant]
Wang et al., Emotion-Semantic-Enhanced Bidirectional LSTM with Multi-Head Attention Mechanism for Microblog Sentiment Analysis, May 22, 2020. [cited by applicant]
Anonymous ACL submission, “Toward the Explainable Soft Prompts: How does Prompt-tuning Exploit a Multilingual Pre-trained Language Model?”, 2022, 18 pages. [cited by applicant]
Anonymous Authors “On the Role of Attention in Prompt-tuning”, Under review at the Workshop on Understanding Foundation Models at ICLR 2023, Year 2023, 45 pages. [cited by applicant]