Layered reasoning stack interfaces

Layered reasoning stack interfaces: state abstraction and Large Language Model (LLM) ↔ Energy-Based Model (EBM) protocols

2026-05-17 · agentic-ai llm-reasoning ai-architecture governance-policy formal-methods tools-infrastructure · medium · source → · wiki →
key claims
  1. 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)
  2. 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.)
  3. 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.)
  4. 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)
  5. 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)
  6. 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)
  7. 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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

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

Open Questions


sources

cites
cites Hybrid Architecture Design: Probabilistic Large Language Models (LLMs) for Interpretation, Deterministic Layers for Governance Enforcement
cites What control-plane architecture is required to manage Artificial Intelligence (AI) agents and low-code systems as distributed, semi-autonomous actors within enterprise environments?
cites Language designed for LLM agents to produce: addressing generation-layer failure modes in agentic systems
cites 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?
cites 2026-05-17-deterministic-circuit-breakers-hybrid-reasoning-infrastructure
related (frontmatter)
related Where should governance enforcement points be implemented within enterprise architecture, and how should controls be applied consistently for AI and low-code systems?
related Policy coherence as a machine-checkable prerequisite: policy-as-code, formal specification, and invariant registries for regulated financial institutions deploying agentic Artificial Intelligence (AI)
related Governance Policy Application: Deterministic Requirements vs Stochastic Large Language Model (LLM) Elements

Connected items

Loading…

View full knowledge graph →