r/LanguageTechnology • u/jamescalam • Apr 14 '22
Spotify's Natural Language Search Explained
r/LanguageTechnology • u/jamescalam • Apr 14 '22
r/LanguageTechnology • u/eudaimonia42 • Oct 16 '20
r/LanguageTechnology • u/LesleyFair • Jan 19 '23
The rumor mill is buzzing around the release of GPT-4.
People are predicting the model will have 100 trillion parameters. That’s a trillion with a “t”.
The often-used graphic above makes GPT-3 look like a cute little breadcrumb that is about to have a live-ending encounter with a bowling ball.
Sure, OpenAI’s new brainchild will certainly be mind-bending and language models have been getting bigger — fast!
But this time might be different and it makes for a good opportunity to look at the research on scaling large language models (LLMs).
Let’s go!
Training 100 Trillion Parameters
The creation of GPT-3 was a marvelous feat of engineering. The training was done on 1024 GPUs, took 34 days, and cost $4.6M in compute alone [1].
Training a 100T parameter model on the same data, using 10000 GPUs, would take 53 Years. To avoid overfitting such a huge model the dataset would also need to be much(!) larger.
So, where is this rumor coming from?
The Source Of The Rumor:
It turns out OpenAI itself might be the source of it.
In August 2021 the CEO of Cerebras told wired: “From talking to OpenAI, GPT-4 will be about 100 trillion parameters”.
A the time, that was most likely what they believed, but that was in 2021. So, basically forever ago when machine learning research is concerned.
Things have changed a lot since then!
To understand what happened we first need to look at how people decide the number of parameters in a model.
Deciding The Number Of Parameters:
The enormous hunger for resources typically makes it feasible to train an LLM only once.
In practice, the available compute budget (how much money will be spent, available GPUs, etc.) is known in advance. Before the training is started, researchers need to accurately predict which hyperparameters will result in the best model.
But there’s a catch!
Most research on neural networks is empirical. People typically run hundreds or even thousands of training experiments until they find a good model with the right hyperparameters.
With LLMs we cannot do that. Training 200 GPT-3 models would set you back roughly a billion dollars. Not even the deep-pocketed tech giants can spend this sort of money.
Therefore, researchers need to work with what they have. Either they investigate the few big models that have been trained or they train smaller models in the hope of learning something about how to scale the big ones.
This process can very noisy and the community’s understanding has evolved a lot over the last few years.
What People Used To Think About Scaling LLMs
In 2020, a team of researchers from OpenAI released a paper called: “Scaling Laws For Neural Language Models”.
They observed a predictable decrease in training loss when increasing the model size over multiple orders of magnitude.
So far so good. But they made two other observations, which resulted in the model size ballooning rapidly.
To scale models optimally the parameters should scale quicker than the dataset size. To be exact, their analysis showed when increasing the model size 8x the dataset only needs to be increased 5x.
Full model convergence is not compute-efficient. Given a fixed compute budget it is better to train large models shorter than to use a smaller model and train it longer.
Hence, it seemed as if the way to improve performance was to scale models faster than the dataset size [2].
And that is what people did. The models got larger and larger with GPT-3 (175B), Gopher (280B), Megatron-Turing NLG (530B) just to name a few.
But the bigger models failed to deliver on the promise.
Read on to learn why!
What We know About Scaling Models Today
It turns out you need to scale training sets and models in equal proportions. So, every time the model size doubles, the number of training tokens should double as well.
This was published in DeepMind’s 2022 paper: “Training Compute-Optimal Large Language Models”
The researchers fitted over 400 language models ranging from 70M to over 16B parameters. To assess the impact of dataset size they also varied the number of training tokens from 5B-500B tokens.
The findings allowed them to estimate that a compute-optimal version of GPT-3 (175B) should be trained on roughly 3.7T tokens. That is more than 10x the data that the original model was trained on.
To verify their results they trained a fairly small model on vastly more data. Their model, called Chinchilla, has 70B parameters and is trained on 1.4T tokens. Hence it is 2.5x smaller than GPT-3 but trained on almost 5x the data.
Chinchilla outperforms GPT-3 and other much larger models by a fair margin [3].
This was a great breakthrough!The model is not just better, but its smaller size makes inference cheaper and finetuning easier.
So What Will Happen?
What GPT-4 Might Look Like:
To properly fit a model with 100T parameters, open OpenAI needs a dataset of roughly 700T tokens. Given 1M GPUs and using the calculus from above, it would still take roughly 2650 years to train the model [1].
So, here is what GPT-4 could look like:
Similar size to GPT-3, but trained optimally on 10x more data
Multi-modal outputting text, images, and sound
Output conditioned on document chunks from a memory bank that the model has access to during prediction [4]
Doubled context size allows longer predictions before the model starts going off the rails
Regardless of the exact design, it will be a solid step forward. However, it will not be the 100T token human-brain-like AGI that people make it out to be.
Whatever it will look like, I am sure it will be amazing and we can all be excited about the release.
Such exciting times to be alive!
If you got down here, thank you! It was a privilege to make this for you. At TheDecoding ⭕, I send out a thoughtful newsletter about ML research and the data economy once a week. No Spam. No Nonsense. Click here to sign up!
References:
[1] D. Narayanan, M. Shoeybi, J. Casper , P. LeGresley, M. Patwary, V. Korthikanti, D. Vainbrand, P. Kashinkunti, J. Bernauer, B. Catanzaro, A. Phanishayee , M. Zaharia, Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM (2021), SC21
[2] J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child,… & D. Amodei, Scaling laws for neural language models (2020), arxiv preprint
[3] J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. Casas, L. Hendricks, J. Welbl, A. Clark, T. Hennigan, Training Compute-Optimal Large Language Models (2022). arXiv preprint arXiv:2203.15556.
[4] S. Borgeaud, A. Mensch, J. Hoffmann, T. Cai, E. Rutherford, K. Millican, G. Driessche, J. Lespiau, B. Damoc, A. Clark, D. Casas, Improving language models by retrieving from trillions of tokens (2021). arXiv preprint arXiv:2112.04426.Vancouver
r/LanguageTechnology • u/Quantum_Stat • Oct 07 '20
Hey,
Quantum Stat has curated some of the best public/academic datasets for various tasks in NLP. We have recently passed the 600th mark and we are continuing to add more. Check out the datasets here:
r/LanguageTechnology • u/crowpup783 • Sep 11 '20
Title is pretty self explanatory but i'm curious as to what an average day looks like.
r/LanguageTechnology • u/htrp • Jun 10 '20
r/LanguageTechnology • u/uptown_grayfield • Feb 26 '20
I’ve been working on an interactive pun searching tool (read: given two input categories, searches among them for words that share a lot of sounds). I’ve added a feature that constrains the search just among top level domains so that people can find fun website names that benefit from the rhyme-as-reason effect.
eels.deals
calzone.zone
pastry.page
puns.plus
Leo.CEO
forearms.forum
tulle.tools
lace.place
noun.town
lingo.bingoHere’s a blog post explaining more about the whole project. Basically, it finds category synonyms using word2vec and then finds "puns" using phonetic nearest neighbor vectors. I’m interested in feedback on this and what fun domain names people are able to find, and I'm happy to answer any questions!
The UI has a long way to go! Some notes: you can select to search for words that match via alliteration, rhyme, or flexible phonetic match. And you can click on words in the blue columns to do a more specific sub-search, which can often be more helpful than just looking at the top overall results in the center column.
(Please please let me know if you actually register a domain you found with this.)
r/LanguageTechnology • u/jamescalam • Dec 14 '21
Hi all, the first seven chapters of the course NLP for Semantic Search that I've been working on have been published today. It's all completely free and covers everything you need to get started with building SotA language models for semantic similarity, from machine translation to question-answering, and more!
Semantic search allows us to search language-based data based on the semantics or 'meaning' of a text. It enables machine translation and question-answering, it's how Google understands "what time is it in NYC?", and even allows us to search for images using text-based queries.
It is in essence, a way for us to interact with machines in a more human way. NLP fits in as the 'semantic' in semantic search.
Current chapters are:
Dense Vectors
Sentence Embeddings and Transformers
Training Sentence Transformers with Softmax Loss
Training Sentence Transformers with MNR Loss
Multilingual Sentence Transformers
Question Answering
Unsupervised Training for Sentence Transformers
Let me know what you think, I hope you enjoy it!
r/LanguageTechnology • u/Dawny33 • Sep 03 '20
r/LanguageTechnology • u/xsliartII • Mar 17 '20
Good NLP people,
in light of the recently announced Kaggle challenge:
https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge
there seems to be a strong demand for NLP applications: see here: https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge/discussion/135999
Perhaps we can use this thread to discuss ideas and some other interesting NLP things that can be done regarding this matter.
r/LanguageTechnology • u/adammathias • Nov 13 '19
r/LanguageTechnology • u/zenquiorra • Mar 06 '24
Background: I am a full-time NLP Engineer and I was also into research (published some papers in A-A* rank NLP conferences) till last year.
Recently, I have been working full-time at a startup, we are doing quite cutting-edge stuff in our NLP Domain, at least that's what it felt like.
I was working on 4 NLP tasks for 3 months and 2 of them got demolished by Gemini Pro. I tried getting some novelty in one of those 2 tasks and it was a matter of specific data - some intermediate augmentation/processing and more computational power to get a somewhat better-performing domain-specific output.
But for how long? They will release another huge LLM that can do the same task with a simple prompt.
Recently, we lost a big client because one of the big techs offered what we were doing at 1/10th the cost, they are also subsiding heavily for the time being. (I know they are subsiding because even for in-house computational and processing capacities, this is just absurd pricing) , I also have a vague idea about what model they are using.
We did catch up in output quality and there is some novelty in length and customization capabilities, but how does one compete with pricing?
Forget all that... I spend 4-5 hours every day learning new architectures, reading papers, and all that to get a hang of what is going on in the industry, but a lot of it is so expensive, time-consuming, and resource-intensive for a startup, that you can't use most of it as a viable solution in the long run.
When I was doing just research, it felt easier to catch up as I got a chance of working on something novel and there were funds/grants, and no industry pressure of missing out. Things are so different in the industry - money/resources/client demands/viability .. all this while big tech may beat it sooner or later, they have more resources, and can subsidize heavily!
Is the only option to combat this, is to keep playing catchup, to work with big tech itself, OR to explore and work on something that they are exploring less?
I know domain-specific novelty and a couple of years of experience are there, and honestly, that's what is keeping us relevant as an NLP startup. But for how long?
r/LanguageTechnology • u/aintnosunshine2 • Mar 15 '21
Hi NLP folks,
I have developed a library for NLP with different transformer architectures in Tensorflow 2.0 . The natural question will be, how it is different compared to hugging Face. Hugging face is amazing, no doubt in that, But the Tf 2.0 implementation of Hugging face is way slower compared to PT implementation. Which actually made me think why?
The lack of proper serialization of models is the main reason. To do so, we actually needed to re-design the code. tf-transformers if serialization and more.
As per the benchmarks for text generation using GPT2 and t5 models, it is 80 % faster than HF TF implementations and even faster than PT implementations. All the codes + benchmarks + tutorials released.
Faster Auto Regressive Decoding using Tensorflow2. Faster than PyTorch in most experiments (V100 GPU). 80% faster compared to existing TF based libraries (relative difference) Refer benchmark code.
Complete TFlite support for BERT, RoBERTA, T5, Albert, mt5 for all down stream tasks except text-generation
Faster sentence-piece alignment (no more LCS overhead)
Variable batch text generation for Encoder only models like GPT2
No more hassle of writing long codes for TFRecords. minimal and simple.
Off the shelf support for auto-batching tf.data.dataset or tf.ragged tensors
Pass dictionary outputs directly to loss functions inside tf.keras.Model.fit
using model.compile2 . Refer examples or blog
Multiple mask modes like causal, user-defined, prefix by changing one argument . Refer examples or blog
https://github.com/legacyai/tf-transformers
Please share your thoughts, comments and feedback .
r/LanguageTechnology • u/ai-lover • Sep 22 '20
AI researchers have made significant advancements in building models that can generate text that mimic the natural language. State-of-the-art technology performs so well that it is sometimes hard to distinguish their output from the text written by a person. An essential next step is to make these models generate the fluent and grounded text in real-world knowledge.
KILT (Knowledge Intensive Language Tasks) helps AI researchers and enthusiasts build models that can better leverage real-world information to accomplish a broad range of tasks. Uniting 11 widely used public data sets, KILT represents five different tasks:
Github: https://github.com/facebookresearch/KILT
r/LanguageTechnology • u/colethienes • Nov 25 '19
Hi NLP Community!
I just joined reddit, but I'd like to share my newest project with everyone. It's called NBoost. It's essentially a proxy for search APIs (e.g. Elasticsearch) that reranks search results using finetuned models (e.g. BERT).
Check out our medium article or github to learn more!
r/LanguageTechnology • u/backpropsite • Apr 01 '21
I spent ~50 hours looking for the best resources on various Transformer models and organized them into a website backprop.org.
The website is intended to help everyone learn faster by directly connecting you to the best resources without having to hunt everything down yourself.
Check it out! If people find this useful I'll add more pages on more NLP topics. Already planning on adding pages about RNNs, LSTMs, GRUs, etc.
Also, if you know any great resources that I missed send it my way!
r/LanguageTechnology • u/yoavz • Aug 26 '20
r/LanguageTechnology • u/RyanAI100 • Dec 31 '20
r/LanguageTechnology • u/hijacked_mojo • Nov 14 '22
The Transformer architecture underpins several state-of-the-art models today, and by the end of this module, you'll have a clear understanding of how it works.
We'll explore every layer of the Transformer, then build one from scratch. We'll then learn how to leverage pre-trained models from Hugging Face and OpenAI for our own projects.
We'll cover:
Subword tokenization with byte-pair encoding (BPE).
Self-Attention and how it addresses the drawbacks of recurrence.
How Multi-Head Self-Attention works.
Every step of the encoder and decoder.
Why and how to use pre-trained models in our own work.
How BERT works.
How GPT learning to "predict the next token" leads to all sorts of capabilities.
In the two-part demo, we'll
Build a working Transformer from scratch.
Fine-tune a pre-trained transformer for question answering, and explore all the cool things GPT-3 can do.
YouTube link: https://www.youtube.com/watch?v=acxqoltilME
By the end of this module, you'll have a solid understanding of the Transformer architecture and know how to use pre-trained Transformers to build all sorts of useful applications.
This is the last module for NLP Demystified. If you found this course useful, let me know! I'd love to hear your thoughts and feedback.
r/LanguageTechnology • u/Choice_Willow1890 • Apr 15 '21
Link to paper: https://arxiv.org/abs/2104.06644
Is BERT just a giant bag-of-words??
Relevant meme: https://imgur.com/a/RGUtOvt
r/LanguageTechnology • u/Corp-Por • Jan 28 '20
r/LanguageTechnology • u/reqarfar • Apr 19 '24
Some time ago I read this post on this thread and I completely relate: https://www.reddit.com/r/LanguageTechnology/comments/11zvsnj/soon_nlp_graduate_and_feel_completely_inferior_on/
I originally come from a language background and thought there could be job opportunities in the NLP field, so a couple of years back I enrolled in a master’s programme about NLP and language technology. It turned out to put a lot of emphasis on theory, but even though it was a very demanding programme and I put a lot of effort into it I didn’t really acquire any technical/practical skills apart from some basic coding skills.
After graduating I started working for a NLP company, but in a more linguistic position that will be completely replaced by AI within a couple of years. Although I feel like I did learn some things at this job, I am very far from the technical and coding skills required to work in the field nowadays, especially because everything is constantly changing at such a fast pace. I feel like my timing was completely off. I’m trying to learn on my own, but how can I keep up?
I am not sure how I can progress - I did not acquire these skills at university, so how can I learn them at a job if those skills are required to get the job in the first place? It’s starting to feel like I wasted soo much time as I probably have no future in this field.
Does anybody here come from a Humanities/Language background and managed to keep up enough to get a good job?
r/LanguageTechnology • u/sap9586 • Feb 13 '23
If you're interested in creating a custom intelligent bot using GPT on AWS, this guide provides step-by-step instructions for replicating OpenAI's successful chatbot. 🚀🤖
The guide takes you through the process of training and optimizing a closed-domain single-turn question-answering bot with GPT-2 using your own custom data. Plus, it covers essential concepts such as Proximal Policy Optimization (PPO), Reinforcement Learning from Human Feedback (RLHF), prompt-based learning, prompt engineering, Kullback-Leibler (KL) divergence, and more. https://medium.com/@shankar.arunp/chatgpt-decoded-an-expert-guide-to-mastering-the-technology-and-building-domain-specific-3a95b42827bb?source=friends_link&sk=e025c40b1a15863f94c1a6105d089222
r/LanguageTechnology • u/CS-fan-101 • Jun 09 '23
SlimPajama cleans and deduplicates RedPajama-1T, reducing the total token count and file size by 50%. It's half the size and trains twice as fast!
It’s the highest quality dataset when training to 600B tokens and, when upsampled, performs equal or better than RedPajama. It was no mean feat to deduplicate data on this scale – existing tools do not scale to a trillion tokens. We built a custom parallel data pre-processing pipeline and are sharing the code open source with the community.
We’d like to thank our partner Opentensor for supporting this project. And credit goes to Together Compute and the entire team that created the RedPajama dataset!
SlimPajama dataset - https://huggingface.co/datasets/cerebras/SlimPajama-627B
Libraries for data pre-processing - https://github.com/Cerebras/modelzoo/tree/main/modelzoo/transformers/data_processing/slimpajama
Read our blog - https://www.cerebras.net/blog/slimpajama-a-627b-token-cleaned-and-deduplicated-version-of-redpajama