mixle.experimental.typed_runtime.context_attention moduleΒΆ
Node-, token-, and compute-bounded attention over materialized context tokens.
- class AttentionCandidate(node_id, key, value, position, token_ids, tokenizer_id, materialized_content_hash)[source]
Bases:
objectOne graph node with retrieval vectors and content-bound materialized token IDs.
- Parameters:
- property measured_token_count: int
Token work derived from the materialized token-ID sequence.
- class ContextAttentionConfig(tokenizer_id, exact_near_tokens=4096, exact_near_nodes=64, retrieved_nodes=32, maximum_active_tokens=8192, maximum_active_nodes=96, maximum_scored_nodes=4096, maximum_attention_elements=1000000, temperature=1.0)[source]
Bases:
objectHard bounds and the tokenizer identity used by materialized token sequences.
- class ContextAttentionReceipt(tokenizer_id, source_nodes, source_horizon_tokens, maximum_scored_nodes, maximum_attention_elements, maximum_active_nodes, maximum_active_tokens, scored_nodes, scoring_elements, exact_node_ids, retrieved_node_ids, active_nodes, active_tokens, active_token_counts, excluded_unverified_generated, similarities)[source]
Bases:
objectSelected nodes plus measured, independently bounded token and vector work.
- class ContextAttentionResult(value, receipt)[source]
Bases:
objectAttended value and selection receipt.
- Parameters:
value (ndarray)
receipt (ContextAttentionReceipt)
- bounded_context_attention(query, candidates, graph, config, *, source_horizon_tokens=None)[source]
Attend to recent/retrieved nodes under hard node, token, and vector-work caps.