LLM Length Guidance Embeddings for Precise Word Count Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing large language models (LLMs) struggle to consistently output a specific number of words in response to an input prompt, requiring extensive retraining and varying results, making it difficult to generate summaries of a specified length.

Innovation Solution

Incorporating a length guidance vector, such as a sinusoidal function, into the LLM to encode target lengths, allowing the model to generate output text summaries that accurately match the desired word count within a user-defined tolerance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If extensive retraining is performed to make the LLM output a specific number of words, then the word count accuracy is improved, but the training time and computational resources increase significantly

Engineering Contradiction:
Improveword count accuracyVSAvoidtraining time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-computing sinusoidal position embeddings during the model initialization phase. These position embeddings encode positional information that helps the model inherently understand sequence length without requiring extensive retraining. The sinusoidal functions are calculated in advance and stored, allowing the model to naturally grasp length information when processing sequences, thereby achieving accurate word count control with minimal additional training time.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If extensive retraining is performed to make the LLM output a specific number of words, then the word count accuracy is improved, but the computational resources required increase significantly

Engineering Contradiction:
Improveword count accuracyVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent applies preliminary action by pre-computing sinusoidal position embeddings during the model initialization phase. These position embeddings encode positional information that helps the model inherently understand sequence length without requiring extensive retraining. The sinusoidal functions are calculated in advance and stored, allowing the model to naturally grasp length information when processing sequences, thereby achieving accurate word count control with minimal additional training time.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If the LLM is trained with massive natural language datasets to improve response quality, then the model's language understanding is improved, but the training data requirements and storage needs increase

Engineering Contradiction:
Improvelanguage understanding qualityVSAvoidtraining data volume
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent applies the taking out principle by extracting and isolating the positional encoding component from the overall training process. Instead of relying solely on massive datasets to teach the model about sequence positions and lengths, the patent extracts this specific functionality and implements it through dedicated sinusoidal position embeddings. This separation allows the model to learn language patterns from datasets while simultaneously receiving explicit positional guidance, reducing the burden on training data volume.

Inventive Principle:
Principle #2Taking out (Extraction)

4Adaptability or versatility

If the LLM outputs vary widely from the requested word count even with extra training, then the model's flexibility is maintained, but the consistency and reliability of output length decrease

Engineering Contradiction:
Improvemodel flexibilityVSAvoidoutput length consistency
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent applies feedback by incorporating attention mechanisms that continuously monitor and adjust based on the relationship between input sequences and desired output lengths. The sinusoidal position embeddings provide a feedback signal about positional information, allowing the model to self-correct and maintain consistent output lengths. This feedback loop enables the model to adapt to different length requirements while maintaining reliability, as the position embeddings guide the generation process to match target lengths without sacrificing flexibility.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20250348675A1Length-based large language models
Publication Date: 2025.11.13 FORD GLOBAL TECH LLC
  • US20250348675A1 patent drawing
  • US20250348675A1 patent drawing
  • US20250348675A1 patent drawing

AI summary

A computer that includes a processor and a memory, the memory including instructions executable by the processor to receive a prompt for a large language model, the prompt including an input text and a target length. The large language model can generate an output text that includes a number of words equal to the target length within a user determined tolerance based on a length guidance embedding vector that encodes the target size.