x-transformers
minGPT
x-transformers | minGPT | |
---|---|---|
10 | 35 | |
4,147 | 18,875 | |
- | - | |
8.7 | 0.0 | |
3 days ago | 4 days ago | |
Python | Python | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
x-transformers
- x-transformers
- GPT-4 architecture: what we can deduce from research literature
- Doubt about transformers
-
The GPT Architecture, on a Napkin
it is all documented here, in writing and in code https://github.com/lucidrains/x-transformers
you will want to use rotary embeddings, if you do not need length extrapolation
-
[R] Deepmind's Gato: a generalist learning agent
it is just a single transformer encoder, so just use https://github.com/lucidrains/x-transformers with ff_glu set to True
-
[D] Transformer sequence generation - is it truly quadratic scaling?
However, I've come across the concept of Key, Value Caching in Transformer-Decoders recently (e.g. Figure 3 here), wherein because each output (and hence each input, since the model is autoregressive) only depends on previous outputs (inputs), we don't need to re-compute Key and Value vectors for all t < t_i at timestep i of the sequence. My intuition leads me to believe, then, that (unconditioned) inference for a decoder-only model uses an effective sequence length of 1 (the most recently produced token is the only real input that requires computation on), making Attention a linear-complexity operation. This thinking seems to be validated by this github issue, and this paper (2nd paragraph of Introduction).
-
[D] Sudden drop in loss after hours of no improvement - is this a thing?
The Project - Model: The primary architecture consists of a CNN with a transformer encoder and decoder. At first, I used my implementation of self-attention. Still, due to it not converging, I switched to using x-transformer implementation by lucidrains - as it includes improvements from many papers. The objective is simple; the CNN encoder converts images to a high-level representation; feeds them to the transformer encoder for information flow. Finally, a transformer decoder tries to decode the text character-by-character using autoregressive loss. After two weeks of trying around different things, the training did not converge within the first hour - as this is the usual mark I use to validate if a model is learning or not.
-
Hacker News top posts: May 9, 2021
X-Transformers: A fully-featured transformer with experimental features\ (25 comments)
- X-Transformers: A fully-featured transformer with experimental features
-
[D] Theoretical papers on transformers? (or attention mechanism, or just seq2seq?)
One thing I’ve looked at is the fact that there’s no obvious reason to distinguish between W_K and W_Q in the formulation of a transformer as far as I can tell. However if you build a transformer where you merge the two matrices, it doesn’t learn as well. It still learns, but not as well. You can try out the code here. The training loss can be seen here, though we aborted the run because of how poorly it was doing.
minGPT
- FLaNK AI Weekly for 29 April 2024
-
Ask HN: Daily practices for building AI/ML skills?
minGPT (Karpathy): https://github.com/karpathy/minGPT
Next, some foundational textbooks for general ML and deep learning:
-
[D] What are some examples of being clever with batching for training efficiency?
Language Model novice here. I was going through the README section of minGPT and read this line.
-
LLM Visualization: 3D interactive model of a GPT-style LLM network running inference.
The first network displayed with working weights is a tiny such network, which sorts a small list of the letters A, B, and C. This is the demo example model from Andrej Karpathy's minGPT implementation.
- LLM Visualization
- Learn Machine Learning
-
Facebook Prophet: library for generating forecasts from any time series data
Tried it once. Its promise is to take the dataset's seasonal trend into account, which makes sense for Facebook's original use case.
We ran it on such a dataset and found out that directly using https://github.com/karpathy/minGPT consistently gives a better result. So we ended up using the output of Prophet as an input feature to a neural network, but the result was not improved in any significant way.
-
Tokenization of numerical series
Sure, im trying to regenerate a bunch of complex numbers based on their absolute value. So im trying to embed these absolute values and then using gpt model(probably mini gpt) try to recover the original comples numbers. There is a certain connection between these complex numbers and their order which im not capable of explaining yet. Im hoping the model would be capable of recognizing certain sequences of these absolute values and match them with the desired complex counterparts (by training the model).
-
Anyone know of any articles on training a LLM from scratch on a single GPU?
minGPT (https://github.com/karpathy/minGPT)
-
Understanding LLMs(to the best of our knowledge)
Check out minGPT and nanoGPT from Karpathy, he puts out some of the best machine learning tutorials and teaching content.
What are some alternatives?
EasyOCR - Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
nanoGPT - The simplest, fastest repository for training/finetuning medium-sized GPTs.
TimeSformer-pytorch - Implementation of TimeSformer from Facebook AI, a pure attention-based solution for video classification
gpt-2 - Code for the paper "Language Models are Unsupervised Multitask Learners"
flamingo-pytorch - Implementation of 🦩 Flamingo, state-of-the-art few-shot visual question answering attention net out of Deepmind, in Pytorch
simpletransformers - Transformers for Information Retrieval, Text Classification, NER, QA, Language Modelling, Language Generation, T5, Multi-Modal, and Conversational AI
DALLE-pytorch - Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch
Pytorch-Simple-Transformer - A simple transformer implementation without difficult syntax and extra bells and whistles.
memory-efficient-attention-pytorch - Implementation of a memory efficient multi-head attention as proposed in the paper, "Self-attention Does Not Need O(n²) Memory"
nn-zero-to-hero - Neural Networks: Zero to Hero
performer-pytorch - An implementation of Performer, a linear attention-based transformer, in Pytorch
huggingface_hub - The official Python client for the Huggingface Hub.