Copy-Or-Generate Decoding for Faster, Secure Text Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large neural language models face issues with slow inference time, high computational cost, and security vulnerabilities due to prompt attacks, while smaller transformer models struggle with generalization on longer input lengths.

Innovation Solution

A copy-or-generate model architecture with a semi-sandboxed or fully sandboxed decoding configuration that uses context compression and embedding aggregation, enabling efficient text generation by determining whether to generate or copy tokens based on learnable weights, thus preventing data leakage and improving generalization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If large neural language models are used to improve text generation performance and generalization, then accuracy and functionality are improved, but inference time increases and computational cost increases

Engineering Contradiction:
Improvetext generation accuracyVSAvoidinference time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the text generation process into two distinct pathways: a generation pathway that creates new tokens and a copying pathway that directly copies tokens from the input context. This segmentation allows the model to use a smaller architecture while achieving high accuracy by selectively copying relevant information rather than generating everything from scratch, thereby reducing inference time while maintaining text generation quality.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a copying mechanism where the model can directly copy tokens from the input context to the output, bypassing the need for complex generation processes. This copying capability allows smaller models to achieve performance comparable to large models by efficiently reusing input tokens, thus reducing computational cost and inference time while maintaining accuracy.

Inventive Principle:
Principle #26Copying

2Adaptability or versatility

If large neural language models are used to improve text generation performance, then functionality is improved, but computational cost increases

Engineering Contradiction:
Improvetext generation functionalityVSAvoidcomputational cost
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent implements a dynamic switching mechanism that adaptively chooses between generation and copying operations based on the specific context and requirements of each text generation task. This dynamic approach allows the model to optimize computational resource usage by selecting the most efficient operation for each token, maintaining high functionality while reducing overall computational cost compared to static large models.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the operational parameters of the model by introducing a copy probability parameter that controls the likelihood of copying versus generating tokens. This parameter adjustment allows the model to adapt its behavior to different computational budgets and task requirements, achieving high functionality with variable computational costs depending on the specific generation needs.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If models are designed to handle prompt attacks and prevent data leakage, then security is improved, but model complexity increases

Engineering Contradiction:
Improvesecurity against prompt attacksVSAvoidmodel architecture complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts sensitive information from the input context and stores it in a separate memory structure, preventing the model from directly accessing or memorizing proprietary data during training. This extraction approach allows the model to utilize the information for generation tasks while maintaining security, as the actual sensitive data never becomes part of the model's internal representations, thus improving security without significantly increasing complexity.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces an intermediary copying mechanism that acts as a mediator between the input context and the output generation. Instead of the model directly learning from and potentially leaking sensitive input data, the copying mechanism selectively reproduces necessary tokens without requiring the model to internalize the data, thereby preventing prompt injection attacks and data leakage while maintaining functional complexity at acceptable levels.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250217683A1Copy-Or-Generate Model With Semi-Sandboxed Or Fully Sandboxed Decoding To Handle Text Generation Tasks In Accurate And Secure Manner
Publication Date: 2025.07.03 ORACLE INT CORP
  • US20250217683A1 patent drawing
  • US20250217683A1 patent drawing
  • US20250217683A1 patent drawing

AI summary

A copy-or-generate model architecture is provided that a generates generation distribution obtained from the outputs of the last decoder layer and a copy distribution built from the cross-attention scores of the last decoder layer. The model applies copy weights to the generation distribution and copy distribution to determine whether to generate a next token or to copy a token from the prompt. The model provides better security by ensuring that the input values from the prompt are directly copied to the output when appropriate, such that the model is blind to the original values to copy. In a semi-sandboxed configuration, additional information may be input to the model to help the model adapt the output based on the context of those input fields.