IP Library Granted Patent US 12670326
Granted Patent B1
US 12670326 · App. 19/274,475 · Granted Jun 30, 2026

Pivotal token search by perplexity

Inventors: Ofir Ben Shoham (Hod Hasharon, IL); Matan Vetzler (Givatayim, IL); Amir Bialer (Tel Aviv, IL); Shai Ardazi (Petach-Tikva, IL)
Assignee: Intuit Inc.
G06F40/284G06F40/166
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 12670326
App. No.
19/274,475
Filed
Jul 18, 2025
Granted
Jun 30, 2026
Kind
B1
Art Unit
2659
USPC
704/9
Abstract

Systems and methods for identifying pivotal tokens are disclosed herein. An example method is performed by one or more processors of a computing system. The example method may include receiving, over a communications network from a computing device, a transmission including one or more input texts formed from a token sequence. The example method may include generating substitute token candidates for each input text based on its context, each substitute token candidate mapped to a resultant text in which the substitute token candidate replaces one or more tokens in the sequence. The example method may include determining a baseline perplexity score for each input text. The example method may include determining a candidate perplexity score for each resultant text associated with each input text. The example method may include identifying one or more pivotal tokens within each input text based on the baseline perplexity scores and the candidate perplexity scores.

Claims (46)

1 . A computer-implemented method for identifying pivotal tokens, the method performed by one or more processors of a computing system and comprising:

receiving, over a communications network from a computing device, a transmission including one or more input texts, each of the input texts formed from a sequence of tokens;

generating one or more substitute token candidates for each input text based on a contextual meaning of the input text, the contextual meaning determined by a language model (LM) in a vector space, and each of the substitute token candidates generated to test an impact on the contextual meaning of the input text when the substitute token candidate replaces one or more tokens in the input text;

generating, for each substitute token candidate, a resultant text in which the substitute token candidate replaces one or more tokens in the corresponding input text;

determining, for each resultant text, whether the replacement of the one or more tokens with the corresponding substitute token candidate results in the resultant text having a linguistic coherence below a linguistic threshold;

filtering ones of the resultant texts having a linguistic coherence below the linguistic threshold;

determining a baseline perplexity score for each input text, the baseline perplexity score quantifying the LM's uncertainty in predicting the respective input text without any of the substitute token candidates;

determining a candidate perplexity score for each remaining resultant text, the candidate perplexity score quantifying the LM's uncertainty in predicting the respective resultant text with the corresponding substitute token candidate;

determining, for each input text, a perplexity difference between (i) the baseline perplexity score determined for the respective input text and (ii) the candidate perplexity score determined for the remaining resultant text, wherein the perplexity difference quantifies an extent to which the substitute token candidate causes a semantic path of the resultant text to deviate from a semantic path of the input text in the vector space associated with the contextual meaning of the respective input text;

flagging one or more of the resultant texts associated with a perplexity difference exceeding a perplexity difference threshold; and

identifying, as a pivotal token, the one or more tokens in the input text that were replaced by the substitute token candidate in each flagged resultant text.

2 . The method of claim 1 , wherein each of the input texts corresponds to a concatenation of output tokens from the LM, and wherein the output tokens align with a preferred response from the LM when receiving a particular input prompt.

3 . The method of claim 1 , wherein the substitute token candidates comprise, for each token in each input text, one substitute token candidate for each token in the LM's vocabulary.

4 . The method of claim 1 , wherein the substitute token candidates are selectively generated for the input text based on its contextual meaning.

5 . The method of claim 4 , wherein the input text includes a sequence of terms formed by the tokens, wherein each substitute token candidate is a substitute for one of the terms, and wherein selectively generating the substitute token candidates includes:

selectively identifying one or more of the terms for replacement based on the contextual meaning of the input text; and

selectively identifying, for each of the terms for replacement, a set of substitute terms based on a contextual meaning of the term within the contextual meaning of the input text.

6 . The method of claim 4 , wherein the input text includes a sequence of sentences formed by sequences of terms formed by the tokens, wherein each substitute token candidate is a substitute for one of the sentences, and wherein selectively generating the substitute token candidates includes:

selectively identifying one or more of the sentences for replacement based on the contextual meaning of the input text; and

selectively identifying, for each of the sentences for replacement, a set of substitute sentences based on a contextual meaning of the sentence within the contextual meaning of the input text.

7 . The method of claim 1 , wherein filtering ones the resultant texts is based on a linguistic validation technique.

8 . The method of claim 7 , wherein the linguistic validation technique comprises, for each resultant text:

determining whether the linguistic coherence of the resultant text is greater than a linguistics threshold; and

(i) filtering the resultant text responsive to determining that the linguistic coherence is not greater than the linguistics threshold or (ii) refraining from filtering the resultant text responsive to determining that the linguistic coherence is greater than the linguistics threshold.

9 . The method of claim 8 , wherein the linguistic coherences are determined independent of the contextual meaning of the input text.

10 . The method of claim 1 , wherein the baseline perplexity score and the candidate perplexity scores are based in part on the contextual meaning of the input text.

11 . The method of claim 1 , wherein each of the pivotal tokens comprises a subsequence of tokens forming a term within the input text, and wherein each of the substitute token candidates comprises a sequence of characters forming a substitute term.

12 . The method of claim 1 , wherein each of the pivotal tokens comprises a subsequence of tokens forming a sequence of terms into a sentence within the input text, and wherein each of the substitute token candidates comprises a sequence of terms forming a substitute sentence.

13 . The method of claim 1 , wherein a resultant text associated with a highest perplexity difference is flagged for the given input text.

14 . The method of claim 1 , further comprising:

generating training data based on the pivotal tokens and the flagged resultant texts.

15 . The method of claim 14 , wherein the training data is for a direct preference optimization (DPO) technique, and wherein generating the training data includes:

generating, for each input text, one or more DPO pairs based on its pivotal tokens and flagged resultant texts, wherein each DPO pair includes the input text and the resultant text in which the pivotal token is replaced by the substitute token candidate mapped to the flagged resultant text, wherein the DPO pairs are iteratively updated and used in conjunction with the DPO technique to train the LM until a loss value converges to a predetermined threshold amount for generating output aligned with one or more preferences.

16 . A system for identifying pivotal tokens, the system comprising:

one or more processors; and

at least one memory coupled to the one or more processors and storing instructions that, when executed by the one or more processors, cause the system to perform operations including:

receiving, over a communications network from a computing device, a transmission including one or more input texts, each of the input texts formed from a sequence of tokens;

generating one or more substitute token candidates for each input text based on a contextual meaning of the input text, the contextual meaning determined by a language model (LM) in a vector space, and each of the substitute token candidates generated to test an impact on the contextual meaning of the input text when the substitute token candidate replaces one or more tokens in the input text;

generating, for each substitute token candidate, a resultant text in which the substitute token candidate replaces one or more tokens in the corresponding input text;

determining, for each resultant text, whether the replacement of the one or more tokens with the corresponding substitute token candidate results in the resultant text having a linguistic coherence below a linguistic threshold;

filtering ones of the resultant texts having a linguistic coherence below the linguistic threshold;

determining a baseline perplexity score for each input text, the baseline perplexity score quantifying the LM's uncertainty in predicting the respective input text without any of the substitute token candidates;

determining a candidate perplexity score for each remaining resultant text, the candidate perplexity score quantifying the LM's uncertainty in predicting the respective resultant text with the corresponding substitute token candidate;

determining, for each input text, a perplexity difference between (i) the baseline perplexity score determined for the respective input text and (ii) the candidate perplexity score determined for the remaining resultant text, wherein the perplexity difference quantifies an extent to which the substitute token candidate causes a semantic path of the resultant text to deviate from a semantic path of the input text in the vector space associated with the contextual meaning of the respective input text;

flagging one or more of the resultant texts associated with a perplexity difference exceeding a perplexity difference threshold; and

identifying, as a pivotal token, the one or more tokens in the input text that were replaced by the substitute token candidate in each flagged resultant text.