Arrakis’s documentation!#

AttentionHeadComposition#

AttentionTools#

CausalTracingIntervention#

KnowledgeGraphExtractor#

KnowledgeProber#

LogitAttribution#

LogitLens#

class core_arrakis.logit_lens.LogitLens(model)#

Bases: BaseInterpretabilityTool

Analyzes the logit lens of the model.

layer_attributions(input_ids, target_idx)#

Computes the attributions of the layers.

logit_lens(input_ids, target_idx, layer_idx)#

Computes the logit lens of the model.

ModelSurgery#

class core_arrakis.model_surgery.ModelSurgery(model)#

Bases: BaseInterpretabilityTool

Performs surgery on the model. Replaces, deletes, or permutes layers(in context).

delete_layers(indices)#

Deletes the specified layers(in context).

get_model()#
permute_layers(indices)#

Permutes the layers based on the given indices(in context).

replace_layers(indices, replacements)#

Replaces the specified layers with the given replacements(in context).

ReadWriteHeads#

ResidualDecomposer#

ResidualTools#

SparsityAnalyzer#

SuperpositionDisentangler#