🤖 AI Summary
In multi-step LLM workflows, accumulated context induces hallucinations, intermediate output confusion, and loss of task constraints. To mitigate context contamination, we propose NormCode—a semi-formal language enforcing strict data isolation and stepwise reasoning: each step accepts only explicit inputs, decoupling semantic reasoning (non-deterministic LLM inference) from syntactic operations (deterministic data manipulation). NormCode introduces a novel tri-format isomorphism (.ncds/.ncd/.ncn) enabling progressive formalization—from human-authored drafts to machine-executable code to human-verified artifacts. It integrates dependency-aware scheduling, SQLite-based checkpointing, and native loop management, ensuring end-to-end auditability. Evaluated on arbitrary-length X-ary addition, NormCode achieves 100% accuracy; it further successfully self-hosts a five-stage compiler. This work establishes a traceable, hallucination-resistant AI planning infrastructure for high-stakes domains including law, healthcare, and finance.
📝 Abstract
Multistep workflows that chain large language model (LLM) calls suffer from context pollution: as information accumulates across steps, models hallucinate, confuse intermediate outputs, and lose track of task constraints. We present NormCode, a semiformal language for constructing plans of inferences, structured decompositions where each step operates in data isolation and receives only explicitly passed inputs, which eliminates crossstep contamination by design. NormCode enforces a strict separation between semantic operations (LLMdriven reasoning, nondeterministic) and syntactic operations (deterministic data restructuring), enabling precise cost and reliability tracing. The language exists in three isomorphic formats: .ncds for human authoring, .ncd for machine execution, and .ncn for human verification, supporting progressive formalization from sketch to production. We validate NormCode through two demonstrations: (1) a base X addition algorithm achieving 100 percent accuracy on arbitrary length inputs, and (2) self hosted execution of NormCode's own five phase compiler pipeline. The working orchestrator provides dependency driven scheduling, SQLite backed checkpointing, and loop management, making AI workflows auditable by design and addressing a critical need for transparency in high stakes domains such as legal reasoning, medical decision making, and financial analysis.