NVIDIA-Merlin / NVIDIA-Merlin/Transformers4Rec

[FEA] Feature to extract attention values from transformer heads

Open
#745 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/needs-triage
Dominant language
Python
Stars
1.3k
Forks
165
Avg merge
1m
Merged PRs (30d)
2

Description

🚀 Feature request

Ability to extract attention weights from various heads of transformer

Motivation

Plotting attention provides insights into the inner-workings and user behaviors that business teams can relate with. This is easily available with pytorch / Tensorflow.

Is there a way to convert the trained model to PT / TF models to capture the attention values?

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the existing transformer model and export paths, then determine how attention values could be exposed for individual heads in the supported PyTorch or TensorFlow workflows; done would mean a documented, tested way to extract those values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch, tensorflow
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.