Principle:Protectai Llm guard Reading Time Enforcement
| Knowledge Sources | |
|---|---|
| Domains | Output_Quality, Content_Filtering |
| Last Updated | 2026-02-14 12:00 GMT |
Overview
Enforcing maximum reading time limits on generated text to ensure output brevity.
Description
Large language models have a tendency to produce verbose or excessively long responses, which can overwhelm users and reduce the effectiveness of the communicated information. This principle provides a guardrail that estimates the reading time of generated text and enforces a configurable maximum time limit.
The estimation uses a straightforward formula based on word count and average human reading speed. The widely accepted average reading speed for English prose is approximately 200 words per minute. By dividing the total word count of the output by this rate, the system obtains an estimated reading time in minutes.
If the estimated reading time exceeds the configured maximum, the output is flagged as too long. Optionally, the system can truncate the output to fit within the allowed reading time by removing words from the end until the word count falls within the acceptable range.
Usage
Apply this principle when response length must be controlled:
- Chat interfaces where users expect concise, digestible answers.
- Mobile applications where screen real estate is limited and long text is impractical.
- Time-sensitive contexts where users need quick, scannable information.
- Systems with downstream processing constraints that limit input text length.
- Any application where verbosity degrades user experience.
Theoretical Basis
The reading time enforcement algorithm operates as follows:
1. Split the output text into individual words using whitespace tokenization.
2. Count the total number of words: N = len(words).
3. Compute the estimated reading time:
reading_time_minutes = N / reading_speed
where reading_speed defaults to 200 words per minute.
4. Compare the estimated reading time against the configured maximum:
if reading_time_minutes > max_reading_time, flag the output.
5. If truncation is enabled:
a. Compute the maximum allowed word count:
max_words = max_reading_time * reading_speed
b. Truncate the word list to max_words elements.
c. Rejoin the truncated word list into a string.
6. Return the pass/fail status and the (optionally truncated) output text.