Skip to content

Add embedding-space experiments - #9

Closed
peterbjohnson wants to merge 3 commits into
mainfrom
transformer-visualisation
Closed

peterbjohnson wants to merge 3 commits into
mainfrom
transformer-visualisation

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

Summary

Adds the embedding-space experiments on the token embeddings of Bengio, GPT-2 and SmolLM2, as educational material and a starting point for the transformer visualisation work.

  • report.md: findings and a ranked shortlist of examples for the course
  • results.md: numbers generated by embeddings.py
  • embeddings.py: runs the experiments and produces the figures
  • plots/: PCA and direction plots for gender, plural and country to capital

Deployment impact

None to the Lambda. All 11 files are new and sit under educational_material/embeddings/, which the Dockerfile does not copy and the app does not import. Merging to main will still trigger the staging deploy.

Testing

Trial merge against main was clean. The tests and embeddings.py were not re-run on the merged result.

🤖 Generated with Claude Code

peterbjohnson and others added 3 commits November 4, 2026 22:58
Nearest neighbours, analogies, learned directions and 2D plots, used to
pick course examples showing that directions in embedding space carry
meaning. report.md has the recommendations; results.md and plots/ are
generated by embeddings.py. No production code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peterbjohnson
peterbjohnson deleted the transformer-visualisation branch November 9, 2026 08:34
@peterbjohnson

Copy link
Copy Markdown
Member Author

Closed because of naming issues (branch name was transformer-visualisation, but content was only embedding experiments). Same code appears in #10 under the correct name.

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