Skip to content

Index

forking

AnalyzeScratchbubbles(spec: ExecutionSpec, base: Optional[Node] = None)

Bases: ForkAnalysis

Analyze fork behavior in a Scratchbubbles checkpoint.

AnalyzeThoughtbubbles(spec: ExecutionSpec, base: Optional[Node] = None)

Bases: ForkAnalysis

Analyze fork behavior in a regular Thoughtbubbles checkpoint.

AnalyzeScratchSelector(spec: ExecutionSpec, base: Optional[Node] = None)

Bases: AnalyzeScratchbubbles

Capture selector probabilities, independently of the transformer attention.

measure_selector(weights: np.ndarray, query_positions: np.ndarray, source_positions: np.ndarray, source_scores: np.ndarray, token_ids: list[int], token_text: list[str], top_k: int) -> dict[str, Any] staticmethod

Keep key-stream probabilities and pool their mass by original token.

FullPrefixEvaluator(spec: ExecutionSpec, base: Node | None = None)

Bases: Evaluator[M], Generic[M]

Evaluate cacheless forking models by recomputing the visible prefix.

DiversityScratchbubbles

Bases: Scratchbubbles

Scratchbubbles training model with fork-diversity instrumentation.

measure_friend_diversity(x: jax.Array, token_index: jax.Array) -> jax.Array staticmethod

Measure mean cosine distance between non-rightmost siblings.

decode(x: jax.Array, padding_mask: Optional[jax.Array] = None, deterministic: bool = False, **kwargs: Any) -> Any

Decode while recording states immediately after each fork.