Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Topological order scoring is not accurate #75

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Conversation

frankaging
Copy link
Collaborator

@frankaging frankaging commented Jan 19, 2024

Descriptions:

Currently sorting thing does not work for path patching configs such as,

def path_patching_config(
    layer, stream="head_attention_value_output", num_layers=gpt.config.n_layer
):
    intervening_component = [
        IntervenableRepresentationConfig(layer, stream, "h.pos", group_key=0)
    ]
    restoring_components = []
    if not stream.startswith("mlp_"):
        restoring_components += [
            IntervenableRepresentationConfig(layer, "mlp_output", group_key=1)
        ]
    for i in range(layer+1, num_layers):
        restoring_components += [
            IntervenableRepresentationConfig(i, "attention_output", group_key=1),
            IntervenableRepresentationConfig(i, "mlp_output", group_key=1)
        ]
    intervenable_config = IntervenableConfig(
        intervenable_representations=intervening_component + restoring_components,
        intervenable_interventions_type=VanillaIntervention,
    )
    return intervenable_config

intervenable_config = path_patching_config(
    layer=4, 
    stream="head_attention_value_output"
)
intervenable = IntervenableModel(intervenable_config, gpt)

@frankaging frankaging merged commit 7eda5d1 into main Jan 19, 2024
1 check passed
@frankaging frankaging deleted the zen/iti branch January 29, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant