pycognition: A Dual-Process Cognitive Architecture Integrating Deterministic Procedural Execution and Deliberative LLM Synthesis
Year: 2026
Type: preprint
Abstract: pycognition is an open-source neurosymbolic framework formalizing psychological Dual-Process Theory for autonomous software agents. Contemporary agent architectures (e.g., ReAct, AutoGen) uniformly route deterministic and repetitive sub-tasks through stochastic foundation model APIs, incurring substantial latency, financial token overhead, and execution drift. pycognition addresses this efficiency gap via a segregated execution topology: an ultra-fast procedural tier (System 1, executing validated Python scripts at sub-millisecond latencies with zero API token consumption) and a deliberative reasoning tier (System 2, orchestrating frontier LLM inference). The Skill Crystallization pipeline compiles verified reasoning traces into strongly typed procedural modules, fortified by Abstract Syntax Tree (AST) safety inspection and sandboxed unit testing via pytest prior to dynamic memory ingestion. Key Empirical Findings (N = 100 heterogeneous benchmark tasks): Marginal Procedural Speedup: Compiled System 1 routines achieve a mean latency of 0.292 ms vs. 3,307.41 ms for algorithmic LLM calls (11,326.7x marginal speedup) and 5,580.36 ms for aggregate System 2 deliberation (19,103.9x). Realistic Break-Even Dynamics: Explicitly accounting for autonomous script development latency (mean 7,192.20 ms / cold-start 10,499.60 ms), the per-skill break-even point is reached at k = 4 calls under ideal synthesis and k = 5 calls accounting for the 36.2% sandbox rejection rate. Workload Execution Time: Asynchronous task response time across 85 algorithmic tasks decreased by 44.7% (155.46 s vs. 281.13 s baseline). Full synchronous cluster break-even is reached at N* ≈ 207 tasks. Token Amortization: Cumulative token expenditure dropped by 38.0% (53,978 vs. 87,061 tokens), scaling to 71.4% procedural coverage in the steady-state final quartile. Defensive Sandboxing: The verification harness filtered 17 flawed candidate modules (36.2%), preventing silent runtime regressions and guaranteeing 100% execution fidelity across all System 1 invocations. Package Contents: pycognition_preprint_en.pdf: Full English preprint (canonical academic version) pycognition_preprint_de.pdf: Vollständiger wissenschaftlicher Preprint in deutscher Sprache. pycognition_preprint_ru.pdf: Полная академическая версия статьи на русском языке. pycognition_preprint_trilingual.html: Monolithic standalone HTML manuscript with native MathML equations. metrics_100_deepseek.csv: Raw benchmark execution telemetry and latency measurements.
Author: Riabtsev, Oleh
Institution: University of Vechta
Language: English
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7225347803
