A Deterministic Linguistic Entropy Gate for Large Language Model Pipelines

Read full text
Authors: ERNESTO ROSATI BERISTAIN
Cited by: 0

Abstract

llm-entropy-filter is a deterministic linguistic entropy gate designed for use in large language model (LLM) pipelines. The system analyzes incoming text using rule-based heuristics to estimate linguistic entropy and structural signals commonly associated with spam, prompt injection attempts, or anomalous inputs. Unlike probabilistic classifiers or machine-learning filters, the engine operates through a deterministic scoring mechanism defined by configurable rulesets. This design ensures predictable behavior, reproducibility, and low computational cost, making the filter suitable as a lightweight pre-processing or middleware layer in AI systems. The engine evaluates textual signals such as structural irregularities, excessive repetition, shouting patterns, spam indicators, and other linguistic anomalies. These signals are combined into an entropy score that can trigger configurable actions such as: pass (allow input) review (flag for inspection) block (reject input) Because the evaluation process is deterministic and configuration-driven, outcomes are fully reproducible across deployments. The filter can therefore be used as a transparent and auditable gate before invoking computationally expensive LLM inference. The project is implemented in JavaScript/TypeScript and distributed under the Apache-2.0 license. It includes example integrations, configurable rulesets, benchmarking scripts, and documentation describing the architectural design and limitations of the approach. The system does not attempt to infer semantic truth, user intent, or ethical meaning. Instead, it focuses strictly on structural linguistic signals that can be evaluated deterministically. As such, the entropy gate is intended to complement, not replace, higher-level safety or reasoning mechanisms in AI systems. This release accompanies the technical document: “A Deterministic Linguistic Entropy Gate for Large Language Model Pipelines.” github.com/rosatisoft/llm-entropy-filter rosatisoft/llm-entropy-filter: entropy_analysis, intention_evaluation, triad_response, plain_text_summary

Fields of Study & Subjects

Spam and Phishing Detection Adversarial Robustness in Machine Learning Hate Speech and Cyberbullying Detection

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
4 March 2026
Language
EN