Transformer Local Context Using kNN for Large Tabular Data

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Transformer-based models struggle to scale effectively on large and complex tabular datasets due to memory limitations, leading to inefficient processing and reduced predictive performance.

Innovation Solution

Implement a self-attention mechanism that generates local context using k-Nearest-Neighbors (kNN) data points within the input sequence, reducing the amount of context processed and stored, thereby enhancing processing efficiency and accuracy on larger datasets.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If global context is used in self-attention mechanism, then predictive performance is maintained, but memory consumption and processing time increase significantly on large datasets

Engineering Contradiction:
Improvepredictive performanceVSAvoidprocessing efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the global context into multiple local contexts, each associated with a specific query point. Instead of processing all data points globally, the system divides the dataset into regions and creates localized context windows. This segmentation allows the self-attention mechanism to operate on smaller, manageable subsets of data, reducing memory consumption and processing time while maintaining predictive accuracy through localized relevance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements local quality by creating context representations that are specific to each query point's local region rather than using a uniform global context. Each local context is tailored to the specific area of the dataset being queried, providing higher quality and more relevant information for that particular query. This localized approach improves processing efficiency by focusing computational resources on relevant data regions.

Inventive Principle:
Principle #3Local quality

2Use of energy by moving object

If k-Nearest-Neighbors local context is created, then processor consumption and storage usage are optimized, but the complexity of context generation increases

Engineering Contradiction:
Improveprocessor consumptionVSAvoidcontext generation complexity
Core Design Contradiction:
Use of energy by moving objectVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by pre-computing and storing distance metrics or similarity measures between data points before the actual prediction task. This preprocessing step creates an index or cache that accelerates the k-Nearest-Neighbors search process. By performing this computation in advance, the system reduces the computational burden during inference, optimizing processor consumption while managing the complexity through structured pre-processing.

Inventive Principle:
Principle #10Preliminary action

3Quantity of substance

If local context with kNN data points is generated, then the amount of context processed and stored is reduced, but measurement precision of relevant features may be compromised

Engineering Contradiction:
Improvecontext volumeVSAvoidfeature representation accuracy
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent employs parameter changes by dynamically adjusting the number of nearest neighbors (k value) and the size of local context windows based on the specific query point and data distribution. This adaptive parameter adjustment ensures that each local context contains an optimal amount of information - neither too little to compromise accuracy nor too much to waste resources. The system modifies contextual parameters to balance context volume reduction with maintaining feature representation precision.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250384242A1Local context generation of tabular data using nearest neighbors
Publication Date: 2025.12.18 THE TORONTO DOMINION BANK
  • US20250384242A1 patent drawing
  • US20250384242A1 patent drawing
  • US20250384242A1 patent drawing

AI summary

An example operation may include at least one of executing an AI model include a transformer with a self-attention mechanism that includes global context, receiving a query point associated with an input sequence, creating local context for the query point, the local context including kNN data points within the input sequence, generating a context-aware representation of the input sequence based on execution of the self-attention mechanism with the local context, and inputting the context-aware representation to a feedforward network (FFN).