Skip to content

Access attention weights/scores #258

@ruid7181

Description

@ruid7181

Describe the workflow you want to enable

Thank you for the wonderful work of TabPFN!

I would like to check the attention pattern learned by TabPFN from a tabular data, and explore the potential sparsity in the attention towards different tokens. Can you provide guides how I can access the attention weights (in each attention layer of TabPFN)?

Thanks,
Rui

Describe your proposed solution

I noticed the method get_embeddings, which returns the feature vectors, can I use this to calculate the softmaxed cosine similarity as attention weights?

Describe alternatives you've considered, if relevant

No response

Additional context

I'm using the model tabpfn.regressor.TabPFNRegressor locally.

Impact

Medium (Significant enhancement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions