chanind/linear-relational
Linear Relational Embeddings (LREs) and Linear Relational Concepts (LRCs) for LLMs in PyTorch
This tool helps AI researchers and practitioners understand and manipulate how Large Language Models (LLMs) connect subjects to objects within sentences. It takes a collection of example sentences with a subject, relation, and object (like "Paris is located in France") and produces a 'map' (LRE) that reveals the model's internal representation of that relation. You can then use these maps or 'concepts' (LRCs) to understand or even alter a model's behavior, for example, changing its predicted output for a specific subject-relation pair.
No commits in the last 6 months. Available on PyPI.
Use this if you are a researcher or advanced practitioner working with transformer-based LLMs and want to interpret or directly edit the relational knowledge they encode.
Not ideal if you are looking for a high-level API for everyday LLM fine-tuning or prompt engineering without needing to understand the model's internal activations.
Stars
10
Forks
2
Language
Python
License
MIT
Category
Last pushed
Aug 07, 2024
Commits (30d)
0
Dependencies
3
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/transformers/chanind/linear-relational"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
PaddlePaddle/PaddleNLP
Easy-to-use and powerful LLM and SLM library with awesome model zoo.
meta-llama/llama-cookbook
Welcome to the Llama Cookbook! This is your go to guide for Building with Llama: Getting started...
arcee-ai/mergekit
Tools for merging pretrained large language models.
changyeyu/LLM-RL-Visualized
๐100+ ๅๅ LLM / RL ๅ็ๅพ๐๏ผใๅคงๆจกๅ็ฎๆณใไฝ่ ๅทจ็ฎ๏ผ๐ฅ๏ผ100+ LLM/RL Algorithm Maps ๏ผ
mindspore-lab/step_into_llm
MindSpore online courses: Step into LLM