Applying Qian Xuesen’s Engineering Cybernetics to Suppress Hallucinations in Large Language Models
The paper formulates LLM hallucination as systemic noise, builds a forward‑feedback‑adaptive control loop using Prompt engineering, Retrieval‑Augmented Generation and a hallucination detector, proves global asymptotic stability via Lyapunov theory, designs an LQR optimal controller and an MRAC adaptive scheme, and demonstrates up to 5 dB SNR improvement and sub‑5% hallucination rates on standard benchmarks.
Abstract
Hallucinations in large language models (LLMs) are modeled as multi‑source noise that corrupts the desired output. By mapping Qian Xuesen’s engineering cybernetics principles to LLM generation, a three‑layer closed‑loop control system is built: a feed‑forward Prompt optimizer, a feedback Retrieval‑Augmented Generation (RAG) correction loop, and a fact‑verification output filter. Lyapunov analysis proves global asymptotic stability; an LQR regulator jointly optimizes Prompt intensity and RAG depth; a Model‑Reference Adaptive Control (MRAC) scheme compensates knowledge drift online. Experiments on TruthfulQA, HaluEval and FactScore raise the signal‑to‑noise ratio (SNR) from 6.7 dB to 11.7 dB and reduce hallucination rate (HR) below 5 %.
Keywords
Engineering cybernetics, large language models, noise suppression, hallucination control, closed‑loop feedback, optimal control
1 Problem Modeling
1.1 Noise Classification
High‑frequency random noise ξ_h(t) : originates from decoding stochasticity (temperature, top‑p); approximates white noise.
Low‑frequency drift noise ξ_l(t) : caused by knowledge staleness and data‑distribution shift; colored noise with very low frequency.
Pulsed noise ξ_p(t) : triggered by adversarial inputs, producing instantaneous semantic breaks.
1.2 State‑Space Model
The generation process is abstracted as a discrete‑time linear system with state vector x_k = [e_f(k), e_s(k), θ_k]^T , where e_f(k) is factual error, e_s(k) semantic drift, and θ_k the estimated knowledge state. The control input u_k = [u_{ff}(k), u_{fb}(k)]^T consists of feed‑forward Prompt intensity ( u_{ff} ) and feedback RAG depth ( u_{fb} ). Process noise ξ_k captures model uncertainty; observation noise η_k reflects detector error. The system matrices A, B, C, D, G are determined by the model architecture and task characteristics.
1.3 Noise Transfer Function
The noise‑to‑output transfer matrix G_{yξ}(z) is the primary control objective; minimizing its H∞ norm while preserving closed‑loop stability reduces hallucination‑inducing noise.
2 Closed‑Loop Architecture
2.1 Feed‑Forward Controller (Prompt Optimization)
A Multi‑stage Prompt Refinement (MPR) pipeline uses a small language model to iteratively correct ambiguity, grammar, and terminology, mapping the original query Q to an optimized control input Q* . Experiments show MPR reduces hallucination rate by >85 %.
In PID terms, proportional gain K_p emphasizes keyword strength, integral gain K_i accumulates context, and derivative gain K_d suppresses semantic spikes.
2.2 Feedback Controller (RAG Knowledge‑Correction)
The feedback loop consists of:
State observer : a natural‑language‑inference (NLI) based hallucination detector provides the estimate ŷ_k with gain matrix L ensuring exponential error convergence.
Comparator : computes deviation e_k = R_k - ŷ_k (reference R_k from an external knowledge base) and triggers correction when e_k > e_{th} .
Actuator : applies the Chain‑of‑Verification (CoVe) method—generate a verification question, answer it independently, then adjust the original output.
2.3 Output Filter (Fact Verification)
A finite‑impulse‑response FIR filter H_f(z) performs multi‑round self‑refinement to attenuate residual high‑frequency noise.
3 Stability and Robustness
3.1 Lyapunov Stability
Theorem 1 : If feed‑forward gain K_{ff} and feedback gain K_{fb} satisfy the matrix inequalities shown in the figure, the closed‑loop matrix A_{cl}=A-BK_{fb}C fulfills ‖A_{cl}‖_2<1 , guaranteeing global asymptotic stability and convergence to an ultimate bounded set around the origin.
Choosing a quadratic Lyapunov function V(x)=x^TPx leads to the discrete‑time Lyapunov equation P = A^TPA + Q with P positive‑definite.
3.2 H∞ Robust Control
Weighted sensitivity S=(I+GK)^{-1} and complementary sensitivity T=GK(I+GK)^{-1} are shaped by low‑frequency weight W_1 (emphasizing factual error suppression) and high‑frequency weight W_2 (ensuring robustness). The performance bound γ limits the H∞ norm.
S : noise‑suppression capability
T : robust stability
W_1 : low‑frequency weight
W_2 : high‑frequency weight
γ : upper bound
Frequency plots show |S(jω)| stays well below the –6 dB bound in the low‑frequency band, while |T(jω)| decays rapidly at high frequencies, confirming both noise attenuation and robustness.
4 Optimal LQR Controller
4.1 Formulation
The quadratic cost uses state weight Q=diag(q_1,q_2,q_3) (fact accuracy, semantic coherence, knowledge freshness) and control weight R=diag(r_{ff},r_{fb}) (Prompt cost, retrieval cost). The optimal law requires the solution P_{ric} of the discrete Riccati equation Three operating modes are obtained by adjusting the Q/R ratio:
Fact‑sensitive mode ( q_1≫r_{fb} ): emphasizes RAG feedback, tolerates higher retrieval cost.
Real‑time mode ( r_{ff}≪r_{fb} ): favors Prompt optimization, reduces latency.
Balanced mode ( Q≈R ): achieves Pareto‑optimal trade‑off.
4.2 Adaptive MRAC for Knowledge Drift
A reference model with Hurwitz matrix A_m defines the desired dynamics. The state error e_k = x_k - x_{m,k} evolves as The adaptive law updates controller parameters θ_k : with adaptive gain Γ , positive‑definite matrix P_m (Lyapunov solution) and regression vector φ_k . This enables online estimation of drift direction, dynamic adjustment of RAG depth, and reinforcement‑learning‑based Prompt template evolution.
5 Experimental Validation
5.1 Setup
Benchmarks : TruthfulQA (factual accuracy), HaluEval (hallucination detection), FactScore (long‑text factuality). Compared methods : Baseline (no control), FF‑only (Prompt only), FB‑only (RAG only), LQR‑Composite (proposed optimal composite), LQR‑Adaptive (proposed adaptive composite). Metrics : Hallucination Rate (HR), Signal‑to‑Noise Ratio (SNR), Factual Accuracy (FA), Latency.
5.2 Noise Analysis
Figure 2(a) decomposes output into signal and noise, revealing strong non‑stationarity. Figure 2(b) shows noise concentrated in high‑frequency (sampling) and ultra‑low‑frequency (knowledge drift) bands, guiding filter design. Kalman filtering (Figure 2(c)) effectively attenuates noise, and Figure 2(d) compares SNR gains of different control strategies.
5.3 Control Effects
Figure 4(a) shows LQR‑Composite reducing HR from ~35 % (baseline) to <5 % within 20 iterations, converging faster than FF‑only or FB‑only. Figure 4(b) demonstrates that under periodic knowledge‑base updates, the adaptive controller maintains low error while the fixed‑parameter controller’s error accumulates.
5.4 Quantitative Results
Baseline : FA = 62.3 %, HR = 34.8 %, FactScore = 58.6 %, SNR = 6.7 dB, Latency = 1.2 s.
FF‑only : FA = 71.5 %, HR = 28.2 %, FactScore = 67.3 %, SNR = 9.7 dB, Latency = 1.4 s.
FB‑only : FA = 75.2 %, HR = 22.5 %, FactScore = 72.1 %, SNR = 11.2 dB, Latency = 2.8 s.
LQR‑Composite : FA = 82.6 %, HR = 8.3 %, FactScore = 79.4 %, SNR = 11.7 dB, Latency = 2.1 s.
LQR‑Adaptive : FA = 83.1 %, HR = 7.9 %, FactScore = 80.2 %, SNR = 11.9 dB, Latency = 2.3 s.
Key observations:
Composite control outperforms single‑channel control across all metrics, confirming the engineering‑cybernetics principle that combined control yields superior performance.
SNR improves by ~5 dB (≈70 % noise‑power reduction).
Adaptive control retains advantage in dynamic knowledge environments.
Latency of the composite system (2.1 s) lies between Prompt‑only (1.4 s) and RAG‑only (2.8 s), achieving a Pareto improvement.
6 Discussion and Outlook
6.1 Contributions
Reformulated hallucination mitigation as a control‑theoretic noise‑suppression problem, unifying Prompt engineering, RAG, and fact verification.
Provided Lyapunov‑based global stability proofs absent in heuristic methods.
Introduced the first LQR‑based quantitative trade‑off between Prompt intensity and retrieval depth.
6.2 Limitations and Future Work
Current linearized model does not capture deep non‑linear dynamics; future work will explore feedback linearization or sliding‑mode control.
Extending the framework to multi‑model debate settings using decentralized control theory.
Investigating quantum‑control techniques for forthcoming quantum LLMs.
7 Conclusion
Embedding Qian Xuesen’s engineering cybernetics into LLM generation yields a three‑layer closed‑loop system—feed‑forward Prompt optimization, feedback RAG correction, and adaptive knowledge compensation—that guarantees global asymptotic stability, raises SNR by >5 dB, and reduces hallucination rate below 5 %. The results demonstrate a viable path toward trustworthy AI through rigorous control‑theoretic design.
Code example
S = (I + GK)^{-1}为灵敏度函数(噪声抑制能力)
T = GK(I + GK)^{-1}为补灵敏度函数(鲁棒稳定性)
W_1为低频噪声权重(强调事实性错误的抑制)
W_2为高频不确定性权重(保障系统鲁棒性)Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Large-Model Wave and Transformation Guide
Focuses on the latest large-model trends, applications, technical architectures, and related information.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
