What the LLM Should Not Say: Boundary-Aware Context Grounding for A Seven-Channel EEG Agent
Zhiyuan Xu, Yueqing Dai, Junling Li, Junwen Luo · 2026
Read What the LLM Should Not Say: Boundary-Aware Context Grounding for A Seven-Channel EEG Agent by Zhiyuan Xu, Yueqing Dai, Junling Li, Junwen Luo (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-26519.txt.
Introduction
Zhiyuan Xu, Yueqing Dai, Junling Li, and Junwen Luo present NeuraDock Agent, an open-source system that keeps a language model inside safe bounds. The system supports a seven-channel EEG headset. EEG records electrical activity from the scalp. With few channels, coverage is sparse and signal quality varies. A general model can easily invent interpretations the hardware cannot support.
NeuraDock splits the work in two. A fixed local engine parses recordings, checks quality, and runs reviewed analysis steps. The language model sees only a short approved summary and a context pack. The pack states the hardware limits, the available workflows, and the scientific boundaries. Raw EEG never leaves the user's machine. Tests showed identical results across repeated runs. Capture and failure-injection tests confirmed that the data boundary held.
Catalog record
| CREATOR | Zhiyuan Xu, Yueqing Dai, Junling Li, Junwen Luo |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 69 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.26519
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
What the LLM Should Not Say: Boundary-Aware Context Grounding for A Seven-Channel EEG Agent Zhiyuan Xu, Yueqing Dai, Junling Li, Junwen Luo Abstract Large language models (LLMs) can make scientific software easier to use. However, a general model does not automatically know which measurements a particular sensor can support, which algorithms are implemented in the current software, or which conclusions are justified by a computed result. These distinctions are especially important for low-channel electroencephalography (EEG), where sparse spatial coverage and variable signal quality make plausible but unsupported interpretations easy to produce. We present NeuraDock Agent, an open-source architecture that separates a deterministic local EEG engine from a hardware-aware language layer. The numerical engine parses recordings, performs quality control, executes reviewed spectral workflows, and writes machine-readable artifacts. The LLM receives only a compact, allowlisted summary and a versioned context pack. The context describes the seven-channel hardware, reviewed workflows, result fields, implementation boundaries, scientific limits, and reference cases. Raw EEG and dense per-sample arrays remain local. We evaluate the system at three levels. First, 12 recordings produced identical structured results over ten numerical repetitions, and a complete Rest/Task run produced identical result, report, and figure hashes over three repetitions. Second, request-capture and failure-injection experiments confirmed the tested data boundary and preservation of local artifacts under HTTP, malformed-output, and connection failures. Third, a boundary-awareness benchmark tested 36 ordinary and adversarial questions under four context ablations and two LLMs, yielding 288 outputs. Exact four-way boundary classification improved from 58.3% with a generic EEG prompt to 79.2% with the full context layer. The rate of fully correct, fact-complete, and false-claim-free responses increased from 26.4% to 66.7%, while rejection of feasible requests decreased from 27.8% to 8.3%. Full context was not uniformly optimal: hardware-plus-implementation context achieved a slightly higher strict safe-response rate than the complete prompt, motivating selective retrieval rather than indiscriminate context expansion. These results support hardware- and implementation-aware grounding as a practical mechanism for calibrating what an EEG agent accepts, qualifies, or refuses; they do not establish clinical validity or a validated absolute cognitive-load index. Current open-source implementation (release 2026.6.24): https://github.com/Neuradock/eeg-workstation-agent Keywords: low-channel EEG; large language models; hardware-aware AI; deterministic workflow; boundary awareness; scientific software; reproducibility 1 Introduction LLMs are increasingly used as natural-language interfaces to scientific software. In EEG analysis, they can explain terminology, suggest processing steps, generate code, and summarize numerical output. This accessibility is valuable, but it creates an important category error: broad knowledge about EEG does not imply knowledge of a particular device, recording protocol, software version, or result schema. A fluent model may recommend frontal alpha asymmetry for a posterior-only montage, describe a workflow that is not implemented, or translate an engineering quality flag into a neurological conclusion. The central problem is therefore not simply factual recall. It is boundary awareness : the ability to distinguish among at least four questions: 1. Physical boundary: What can the sensor montage observe? 2. Implementation boundary: What does the reviewed software currently implement? 3. Result boundary: What do the deterministic output fields actually report? 4. Scientific boundary: What inference is justified by those observations? These boundaries are related but not interchangeable. For example, occipital electrodes make visual evoked responses physically observable, but they do not imply that a reviewed SSVEP classifier exists. Conversely, a quality workflow may be implemented and return a technically clean recording, but that result does not establish that the participant was attentive. Boundary awareness is especially important for low-channel EEG because sparse spatial sampling makes anatomically plausible but physically unsupported relabeling more likely. A posterior rhythm can be measured accurately at the sensor level and still be incorrectly described as a frontal, temporal, or localized cortical effect. Scientific computation introduces a second concern. EEG analysis already contains substantial analytical flexibility [ 14 ] ; placing stochastic code generation inside the numerical path adds another source of variation. In neurotechnology, stochastic code generation inside the analytical path also introduces liability: a silently changed filter threshold or an unsupported clinical claim can mislead a user or patient. A robust agent architecture should preserve the utility of natural language without allowing the LLM to silently change filters, thresholds, features, or statistical tests. It should also minimize the data sent to an external model, because EEG recordings and associated metadata may be sensitive [ 10 , 2 , 12 ] . We address these issues with NeuraDock Agent, a system in which local, versioned Python workflows remain the source of numerical truth, while an LLM operates as a constrained interpretation and planning layer. The system targets a seven-channel dry-electrode research platform with the formal channel order CP5, CP6, PO3, PO4, O1, Oz, O2 at 250 Hz. A versioned context pack binds the language layer to this hardware, the current workflow registry, result-field meanings, implementation modules, scientific limits, and reviewed cases. The LLM does not receive raw EEG or execute generated analysis code. This paper makes four contributions: 1. We describe a deterministic, privacy-bounded architecture for low-channel EEG agents that separates computation from language behavior. 2. We document the current Visual Cognitive Load workflow as a within-recording posterior-alpha heuristic, including its quality and interpretive limits. 3. We provide system-level evidence for numerical repeatability, tested request minimization, failure isolation, routing behavior, and artifact threshold responses. 4. We introduce a 36-case, four-condition, two-model boundary-awareness benchmark that measures both unsafe acceptance and over-conservative rejection. The intended contribution is a systems and evaluation framework, not a claim that the present software diagnoses cognition, replaces expert EEG analysis, or establishes a clinically validated cognitive-load index. Version Scope The quantitative experiments in this paper refer to the evaluated software snapshot and model runs completed on June 12, 2026. The current public release, 2026.6.24 (source commit 61aada4 ), preserves the same central boundary: reviewed local Python code is the source of numerical truth, while optional LLM calls receive compact allowlisted summaries and versioned context. The public release additionally includes a dedicated Alpha Dynamics workflow, a rolling online visual-load API, a browser dashboard, deterministic synthetic replay, and three quality-gated application demonstrations. Those later additions improve developer access but were not retroactively included in the 288-output boundary benchmark reported here. Statements about benchmark performance therefore apply to the evaluated snapshot unless explicitly labeled as current-release behavior. 2 Related Work 2.1 Deterministic EEG Software MNE-Python [ 4 ] and EEGLAB [ 3 ] provide mature, scriptable EEG analysis environments. Both support a wide range of channel counts and study designs; they do not assume that all users have high-density recordings. Their breadth, however, requires users to make many methodological decisions. NeuraDock Agent is not a replacement for these ecosystems. It is a narrower workflow layer whose hardware assumptions, inputs, outputs, and scientific claims are explicitly constrained. Posterior alpha activity has a long history in visual and attentional research [ 1 , 7 , 16 ] . The relationship between alpha activity and task demand is task-, state-, and protocol-dependent. Accordingly, the present Visual Cognitive Load workflow treats alpha suppression as a relative feature within a recording, not as a universal or diagnostic measure. 2.2 LLM Grounding and Tool Use Retrieval-augmented generation grounds model output in external documents [ 8 ] , while tool-use systems let models select external functions or APIs [ 13