Layered reasoning stack interfaces
Layered reasoning stack interfaces: state abstraction and Large Language Model (LLM) ↔ Energy-Based Model (EBM) protocols
- The boundary should preserve only the fields that change a deterministic decision, namely identity, intended action, target surface, typed arguments, dependency edges, side-effect class, risk or approval state, budget or deadline, and provenance identifiers, while stripping presentation-only surface formCousot (1977)LeCun (2022)Mitchell (2026)
- A canonical typed schema should be the authoritative interchange object because schema validators and structured-generation runtimes can reject malformed or underspecified boundary states before they enter the scoring or execution pathJSON (n.d.)OpenAI (n.d.)
- Code-oriented candidates still need an Abstract Syntax Tree or lossless Concrete Syntax Tree view behind that schema envelope, because schema fields alone do not preserve syntax-sensitive semantics, faithful reconstruction, comments, or formatting-dependent audit trailsPython (n.d.)LibCST (n.d.)
- Plan and code candidates that contain long-range control, data, or resource dependencies should expose a graph projection in addition to tree or schema views, because graph representations capture semantic relations that flatter structures routinely hideAllamanis et al. (2018)Mitchell (2026)
- The protocol between generation and scoring should be stateful, version-negotiated, and explicitly trace normalization, because without one agreed contract version and one reconstruction trail the scored state cannot be audited or compared across iterationsModel (n.d.)Model (n.d.)Mitchell (2026)
- Asynchronous EBM guidance should return localized repair artifacts such as invariant-family scores, named violations, and JavaScript Object Notation (JSON) Patch operations, because local repair preserves validated substructure and focuses correction on the violated part of the state before escalation to broader fallback pathsInternet (6902)Internet (7396)Mitchell (2026)
- The loop should continue only while observable diagnostics improve, such as validator coverage, aggregate energy, contradiction count, or unresolved critical violations, and it should fail closed when progress stalls, deadlines expire, or the same patch path oscillatesModel (n.d.)Mitchell (2026)Internet (6902)
Research Question
What state abstraction boundaries and interface protocols are most effective for mapping Large Language Model (LLM) candidate outputs into Energy-Based Model (EBM) evaluation state spaces while preserving all policy-relevant constraints and minimizing non-functional variance?
Findings
Executive Summary
The most effective boundary is a layered canonical-state interface in which the Large Language Model emits a typed proposal envelope, normalization extracts policy-relevant invariants into canonical fields, and the Energy-Based Model scores that canonical state rather than raw text.
No single representation is enough across plans, code, and natural language: JavaScript Object Notation (JSON) Schema is best as the portable interchange contract, Abstract Syntax Tree or Concrete Syntax Tree views are best when syntax fidelity or reconstruction matters, and graph projections are best for dependency and control relations that span distant nodes.
The protocol should be stateful and versioned, carry provenance and normalization traces, and support localized repair signals such as invariant-specific energy terms and JavaScript Object Notation (JSON) Patch operations before escalation to regeneration or fail-closed fallback.
Key Findings
- The boundary should preserve only the fields that change a deterministic decision, namely identity, intended action, target surface, typed arguments, dependency edges, side-effect class, risk or approval state, budget or deadline, and provenance identifiers, while stripping presentation-only surface form.
- A canonical typed schema should be the authoritative interchange object because schema validators and structured-generation runtimes can reject malformed or underspecified boundary states before they enter the scoring or execution path.
- Code-oriented candidates still need an Abstract Syntax Tree or lossless Concrete Syntax Tree view behind that schema envelope, because schema fields alone do not preserve syntax-sensitive semantics, faithful reconstruction, comments, or formatting-dependent audit trails.
- Plan and code candidates that contain long-range control, data, or resource dependencies should expose a graph projection in addition to tree or schema views, because graph representations capture semantic relations that flatter structures routinely hide.
- The protocol between generation and scoring should be stateful, version-negotiated, and explicitly trace normalization, because without one agreed contract version and one reconstruction trail the scored state cannot be audited or compared across iterations.
- Asynchronous EBM guidance should return localized repair artifacts such as invariant-family scores, named violations, and JavaScript Object Notation (JSON) Patch operations, because local repair preserves validated substructure and focuses correction on the violated part of the state before escalation to broader fallback paths.
- The loop should continue only while observable diagnostics improve, such as validator coverage, aggregate energy, contradiction count, or unresolved critical violations, and it should fail closed when progress stalls, deadlines expire, or the same patch path oscillates.
Assumptions
- Production orchestrators can attach a stable candidate identifier and schema version to every candidate round. Justification: without that capability, version-safe patching and replay become ambiguous.
- Most costly misses in the target deployment are local enough that partial repair saves time over full regeneration. Justification: if misses are usually global, patch feedback would add complexity without enough latency benefit.
Analysis
The evidence supports a layered rather than monolithic interface because each representation family answers a different control question.
Schemas are strong where the boundary needs stable field names, types, required keys, and validator-compatible interchange, but they are weak where the EBM must reason about aliasing, ordering, or long-range dependency.
AST and CST representations solve the inverse problem: they retain structure and, in the CST case, exact source fidelity, but they are poor as a cross-service contract unless their semantics are re-expressed as canonical fields.
That trade-off makes the best design a canonical typed envelope with derivable or attached domain-specific projections rather than one universal representation.
The same reasoning applies to feedback: when the problem is local, patch semantics plus named violation scores keep already-accepted structure intact and target the violated substructure; when the problem is global, the protocol should stop and request regeneration or safe fallback instead of pretending every miss is locally repairable.
Risks, Gaps, and Uncertainties
- The consulted evidence base comes from adjacent literatures on abstract interpretation, schema validation, syntax trees, graph representations, and patch protocols rather than from one end-to-end benchmark that directly compares all three boundary forms inside an EBM-governed agent loop.
- The graph evidence is strongest for source code rather than for natural-language plans, so the recommendation to project plan state into graphs is best read as a bounded analogy from dependency-heavy code representations rather than as a directly benchmarked result.
- The item relies on LeCun's accessible 2022 and 2023 architecture papers rather than on the older tutorial text, so classic EBM interface terminology may be underrepresented even though the higher-level abstraction argument is still supported.
- Exact scalar-threshold settings for convergence, oscillation, and stop conditions remain deployment-specific because the consulted protocol and infrastructure sources specify the need for explicit diagnostics and fail-closed behavior but do not prescribe one universal numeric threshold set.
Open Questions
- What minimum canonical field set supports both natural-language action plans and code patches without forcing two unrelated schemas?
- Which graph vocabulary is most useful for policy scoring over plans, dependency graphs, temporal graphs, or resource-access graphs?
- Can one EBM score both semantic validity and operational risk, or should those be separate energy terms combined only at the control layer?
- What benchmark would best measure whether patch-based feedback actually reduces latency and failure rate relative to full regeneration in production agent loops?
sources
- [ ] LeCun et al. (2006) A Tutorial on Energy-Based Learning - identified from the seed list but not directly consulted because the page returned raw Portable Document Format (PDF) bytes without extractable text in this runtime
- [x] LeCun (2022) A Path Towards Autonomous Machine Intelligence
- [x] Dawid and LeCun (2023) Introduction to Latent Variable Energy-Based Models: A Path Towards Autonomous Machine Intelligence
- [x] OpenAI Structured Outputs
- [x] Model Context Protocol Specification
- [x] Model Context Protocol Architecture overview
- [x] Model Context Protocol Versioning
- [x] Cousot and Cousot (1977) Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints
- [x] JSON Schema What is JavaScript Object Notation (JSON) Schema?
- [x] JSON Schema JavaScript Object Notation (JSON) Schema Specification
- [x] Python Software Foundation Abstract Syntax Trees
- [x] LibCST Why LibCST for Concrete Syntax Trees
- [x] Internet Engineering Task Force (IETF) Request for Comments (RFC) 6902 JavaScript Object Notation (JSON) Patch
- [x] Internet Engineering Task Force (IETF) Request for Comments (RFC) 7396 JSON Merge Patch
- [x] Allamanis et al. (2018) Learning to Represent Programs with Graphs
- [x] Mitchell (2026) Hybrid Architecture Design: Probabilistic Large Language Models (LLMs) for Interpretation, Deterministic Layers for Governance Enforcement
- [x] Mitchell (2026) What control-plane architecture is required to manage Artificial Intelligence (AI) agents and low-code systems as distributed, semi-autonomous actors within enterprise environments?
- [x] Mitchell (2026) Language designed for LLM agents to produce: addressing generation-layer failure modes in agentic systems
- [x] Mitchell (2026) What is the precise technical distinction between code generation and other Large Language Model outputs in terms of external verifiability, and what does this asymmetry imply for safe deployment boundaries in a regulated financial institution?
- [x] Mitchell (2026) Deterministic circuit-breakers and real-time infrastructure constraints for hybrid reasoning stacks