Skip to content

Architecture: DepthScale - Universal Self-Decoder Framework

DepthScale is designed to address the limitations of standard transformer models in complex, multi-step logical reasoning tasks. Our core innovation is the implementation of a Universal Self-Decoder framework that leverages parameter-shared, iterative reasoning. By recursively applying the same set of transformer weights across multiple reasoning steps, we achieve a form of "in-context learning through iteration" while maintaining a constant memory overhead relative to the number of reasoning steps. This architecture enables convergence-based refinement, allowing the model to iteratively refine its internal state and reasoning path until a stable, high-accuracy conclusion is reached.

Module Relationships

The system is structured around a core set of components that manage the state, define the data structures, and execute the iterative decoding process.

graph TD
    A[DepthScale Framework] --> B(universal_yoco.yoco_base);
    A --> C(universal_yoco.types);
    B --> C;
    C --> B;

    subgraph Core Components
        B
        C
    end

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#ccf,stroke:#333,stroke-width:1px
    style C fill:#cfc,stroke:#333,stroke-width:1px

Module Descriptions

The architecture is composed of three primary modules, ensuring clear separation of concerns:

universal_yoco.types

This module serves as the Data Schema Definition Layer. It defines all necessary data structures, including the representation of the input prompt, the intermediate reasoning states, and the final output structures. It ensures type safety and consistency across the entire iterative process, defining how context, memory, and intermediate thoughts are encapsulated.

universal_yoco.yoco_base

This is the Core Reasoning Engine. It encapsulates the parameter-shared transformer logic. This module contains the implementation of the self-decoder mechanism. Crucially, it manages the iterative loop, applying the same set of weights ($\Theta$) repeatedly. It incorporates specialized attention mechanisms designed to maintain semantic coherence across iterations, preventing catastrophic forgetting or drift in the reasoning path.

universal_yoco/__init__.py

This module acts as the Public Interface and Orchestrator. It exposes the primary entry points for the DepthScale framework. It initializes the yoco_base engine, handles the initial data loading and preprocessing using structures defined in types.py, and manages the overall execution flow, including the convergence checks for the iterative refinement process.

Data Flow Explanation

The data flow in DepthScale is inherently iterative and stateful:

  1. Initialization (Orchestrator $\rightarrow$ Engine): The __init__.py orchestrator receives the initial input prompt and converts it into the standardized state representation defined in types.py. This initial state is passed to the yoco_base engine.
  2. Iteration Loop (Engine): The yoco_base engine enters its iterative reasoning loop. In each step ($t$):
    • The current state ($S_t$) is fed into the parameter-shared transformer weights ($\Theta$).
    • The specialized attention mechanisms process $S_t$ to generate a refined intermediate thought or state ($S_{t+1}$).
    • The memory management system (within yoco_base) updates the context based on $S_{t+1}$.
  3. Convergence Check (Engine $\rightarrow$ Orchestrator): After generating $S_{t+1}$, the engine checks a defined convergence criterion (e.g., minimal change in the output logits or state vector).
  4. Refinement or Termination (Orchestrator):
    • If convergence is not met, the orchestrator passes $S_{t+1}$ back to the engine to begin the next iteration ($t+1$).
    • If convergence is met, the loop terminates, and the final state $S_{final}$ is passed back through the orchestrator to produce the final, refined logical output.

This flow ensures that the computational cost per iteration is constant (determined by the fixed transformer size), while the quality of the reasoning is refined based on the number of successful convergence steps.