# US 2025/0384288 A1 · Contextual classification of tabular data for self-attention

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0384288 A1
- Document ID: US20250384288A1
- Status: Published application
- Kind: A1
- Application number: 19/239,681
- Filed: 2025-06-16
- Published: 2025-12-18
- Earliest claimed: 2024-06-14
- Assignees: The Toronto-Dominion Bank
- Applicants: The Toronto-Dominion Bank
- Inventors: Valentin Patrick Marie Thomas; Junwei Ma; Anthony Lawrence Caterini; Rasa Hosseinzadeh; Keyvan Golestan Irani; Guangwei Yu; Maksims Volkovs
- Web page: https://patentgrep.com/patent/US20250384288A1

## CPC

- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/045: Combinations of networks
- G06N 3/0499: Feedforward networks
- G06N 3/09: Supervised learning
- G06F 16/245: Query processing
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An example operation may include at least one of storing tabular data in a database, receiving an input sequence by a transformer model that includes global context, generating a query vector from the input sequence, wherein the query vector corresponds to a data record within the tabular data, generating local context comprising at least one additional vector from the input sequence within a proximity threshold to the query vector within vector space, replacing the global context of the transformer model with the local context, and generating an output based on execution of the transformer model with the local context on the query vector and the tabular data.

## Claims

### Claim 1

An apparatus comprising:
a memory configured to store tabular data; and
a processor communicatively coupled to the memory, the processor configured to:
receive an input sequence by a transformer model that includes global context;
generate a query vector from the input sequence, wherein the query vector corresponds to a data record within the tabular data;
generate local context comprising at least one additional vector from the input sequence within a proximity threshold to the query vector within vector space;
replace the global context of the transformer model with the local context; and
generate an output based on execution of the transformer model with the local context on the query vector and the tabular data.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the processor is further configured to convert a token within the input sequence into the query vector and convert a plurality of additional data tokens in the input sequence into a plurality of key vectors.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the processor is further configured to identify a subset of key vectors that are within the proximity threshold to the query vector within the vector space, and generate the output based on execution of an output layer of an artificial intelligence (AI) model on the query vector and the subset of key vectors.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the processor is further configured to create a shared local context for a plurality of query vectors, and replace the global context with the shared local context when executing the transformer model on the plurality of query vectors.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the processor is further configured to extract metadata of the tabular data which identifies labels within the tabular data, and further generate the local context based on the metadata.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the processor is configured to modify a self-attention mechanism of the transformer model based on the local context, and execute the modified self-attention mechanism on the query vector to generate the output.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the processor is further configured to reduce an amount of tokens within the input sequence based on the local context, and store the reduced amount of the tokens within a memory of a self-attention mechanism of the transformer model.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the transformer model comprises a tabular prior-data fitted network trained on a labeled set of tabular feature data, and the processor is configured to replace the global context of the tabular prior-data fitted network with the local context.

### Claim 9

A method, comprising:
storing tabular data in a database;
receiving an input sequence by a transformer model that includes global context;
generating a query vector from the input sequence, wherein the query vector corresponds to a data record within the tabular data;
generating local context comprising at least one additional vector from the input sequence within a proximity threshold to the query vector within vector space;
replacing the global context of the transformer model with the local context; and
generating an output based on execution of the transformer model with the local context on the query vector and the tabular data.

### Claim 10 (depends on 9)

The method of claim 9, further comprising converting a token within the input sequence into the query vector and converting a plurality of additional data tokens in the input sequence into a plurality of key vectors.

### Claim 11 (depends on 10)

The method of claim 10, further comprising identifying a subset of key vectors that are within the proximity threshold to the query vector within the vector space, and generating the output based on execution of an output layer of an artificial intelligence (AI) model on the query vector and the subset of key vectors.

### Claim 12 (depends on 9)

The method of claim 9, further comprising creating a shared local context for a plurality of query vectors, and replacing the global context with the shared local context when executing the transformer model on the plurality of query vectors.

### Claim 13 (depends on 9)

The method of claim 9, further comprising extracting metadata of the tabular data which identifies labels within the tabular data, wherein the generating the local context further comprises generating the local context based on the metadata.

### Claim 14 (depends on 9)

The method of claim 9, further comprising modifying a self-attention mechanism of the transformer model based on the local context, and executing the modified self-attention mechanism on the query vector to generate the output.

### Claim 15 (depends on 9)

The method of claim 9, further comprising reducing an amount of tokens within the input sequence based on the local context, and storing the reduced amount of the tokens within a memory of a self-attention mechanism of the transformer model.

### Claim 16 (depends on 9)

The method of claim 9, wherein the transformer model comprises a tabular prior-data fitted network trained on a labeled set of tabular feature data, and the replacing comprises replacing the global context of the tabular prior-data fitted network with the local context.

### Claim 17

A computer-readable storage medium comprising instructions which when executed by a processor cause the processor to perform:
storing tabular data in a database;
receiving an input sequence by a transformer model that includes global context;
generating a query vector from the input sequence, wherein the query vector corresponds to a data record within the tabular data;
generating local context comprising at least one additional vector from the input sequence within a proximity threshold to the query vector within vector space;
replacing the global context of the transformer model with the local context; and
generating an output based on execution of the transformer model with the local context on the query vector and the tabular data.

### Claim 18 (depends on 17)

The computer-readable storage medium of claim 17, wherein the processor is further configured to perform converting a token within the input sequence into the query vector and converting a plurality of additional data tokens in the input sequence into a plurality of key vectors.

### Claim 19 (depends on 18)

The computer-readable storage medium of claim 18, wherein the processor is further configured to perform identifying a subset of key vectors that are within the proximity threshold to the query vector within the vector space, and generating the output based on execution of an output layer of an artificial intelligence (AI) model on the query vector and the subset of key vectors.

### Claim 20 (depends on 17)

The computer-readable storage medium of claim 17, wherein the processor is further configured to perform modifying a self-attention mechanism of the transformer model based on the local context, and executing the modified self-attention mechanism on the query vector to generate the output.
