Projects/ESA/Documentation

[ ESA / MLBRICKS KIT 1.0.0B1 ]

ESA Architecture

A moderate architectural view of ESA sequence execution, recurrent state and model composition.

DISTRIBUTIONmlbricks-kitDOCS VERSION1.0.0b1

ARCHITECTURE

A stateful sequence component with model-level tooling around it.

ESA keeps its recurrent sequence state inside the ESA path, while MLBricks handles backend routing, model composition, training, lifecycle operations and generation utilities around that component.

LAYER FLOW

StageRole
Input hidden statesSequence representations enter the ESA layer.
ESA sequence processingThe layer produces updated hidden representations and can carry recurrent state across prefill/decode calls.
Backend resolutionauto,nativeorpytorchcontrols the supported execution route.
Parent modelNormalization, FFN/residual choices, embeddings and LM head are composed byESAModelor another MLBricks parent.

SEQUENCE EXECUTION

Training and generation use different public workflows.

Training and full-sequence inference use normal module calls. Recurrent generation usesprefillfollowed bydecode_step.ESAModel.prepare_generation()and related helpers prepare the model-level generation path without changing the public model structure.

COMPOSITION

When ESA is placed insideBricksor another parentnn.Module, preferESA(..., device=None)and move the complete parent model once with.to(device). This keeps mixers, embeddings, residual paths, FFNs and inputs on the same device.