HN user

jayalammar

563 karma
Posts18
Comments44
View on HN
newsletter.maartengrootendorst.com 1y ago

A Visual Guide to Mixture of Experts (Moe) LLMs

jayalammar
3pts0
txt.cohere.com 2y ago

Building a RAG chatbot with query rewriting and citations

jayalammar
4pts0
news.ycombinator.com 3y ago

Show HN: Visual intuitive explanations of LLM concepts (LLM University)

jayalammar
303pts36
noahpinion.substack.com 3y ago

Will AI take away the coding jobs?

jayalammar
1pts2
txt.cohere.ai 3y ago

Is Generative AI the future or the present?

jayalammar
1pts1
arxiv.org 3y ago

A neural network layer is a key-value/attention memory

jayalammar
2pts0
news.ycombinator.com 4y ago

Show HN: Analyzing top HN posts with language models

jayalammar
117pts43
twitter.com 4y ago

DALL-E 2 generates images of Kermit The Frog in various films

jayalammar
390pts192
www.collaborativefund.com 4y ago

How the Vanderbilt heirs spent $300B in 50 years

jayalammar
2pts2
koaning.io 4y ago

Enjoy the Silence – GridSearch Is Not Enough: Part 7

jayalammar
2pts0
www.nateliason.com 4y ago

Default Now

jayalammar
1pts0
roberttlange.github.io 4y ago

Mle-monitor: A lightweight experiment and resource monitoring tool (2021)

jayalammar
15pts0
drewconway.com 4y ago

The Data Science Venn Diagram (2010)

jayalammar
2pts0
medium.com 4y ago

QuantStack (small company that carries Jupyter): 2021 in review

jayalammar
1pts1
docs.cohere.ai 4y ago

Intro to Basic Semantic Search

jayalammar
2pts1
jalammar.github.io 4y ago

The Illustrated Retrieval Transformer

jayalammar
75pts13
github.com 4y ago

Show HN: Language model analysis and visualization toolkit

jayalammar
4pts0
docs.cohere.ai 4y ago

A Visual Guide to Prompt Engineering

jayalammar
1pts1

We actually just wrote a book with your profile in mind -- especially if by "AI" you're especially interested in LLMs and if you're a visual learner. It's called Hands-On Large Language Models and it contains 300 original figures explaining the main couple hundred intuitions and applications for these models. You can also read it online on the O'Reilly platform. I find that after acquiring the main intuitions, people find it much easier to move on to code implementations or papers.

This is my sense as well. Text generation LLMs haven't been the best source of embeddings for other downstream use cases. If you're optimizing for token embeddings (e.g., for NER, span detection, or token classification tasks), then a token training objective is important. If you need text-level embeddings (e.g., for semantic search or text classification), then that training objective is required (e.g., what Sentence BERT did to optimize BERT embeddings for semantic search).

That's a great list of existing embeddings models (in addition the SentenceBERT models https://www.sbert.net/docs/pretrained_models.html).

This is a field I find fascinating. It's generally the research field of Machine Learning Interpretability. The BlackboxNLP workshop is one of the main places for investigating this and is a very popular academic workshop https://blackboxnlp.github.io/

One of the most interesting presentations in the last session of the workshop is this talk by David Bau titled "Direct Model Editing and Mechanistic Interpretability". David and his team locate exact information in the model, and edit it. So for example they edit the location of the Eiffel Tower to be in Rome. So whenever the model generates anything involving location (e.g., the view from the top of the tower), it actually describes Rome

Talk: https://www.youtube.com/watch?v=I1ELSZNFeHc

Paper: https://rome.baulab.info/

Follow-up work: https://memit.baulab.info/

There is also work on "Probing" the representation vectors inside the model and investigating what information is encoded at the various layers. One early Transformer Explainability paper (BERT Rediscovers the Classical NLP Pipeline https://arxiv.org/abs/1905.05950) found that "the model represents the steps of the traditional NLP pipeline in an interpretable and localizable way: POS tagging, parsing, NER, semantic roles, then coreference". Meaning that the representations in the earlier layers encode things like whether a token is a verb or noun, and later layers encode other, higher-level information. I've made an intro to these probing methods here: https://www.youtube.com/watch?v=HJn-OTNLnoE

A lot of applied work doesn't require interpretability and explainability at the moment, but I suspect the interest will continue to increase.

I'm the author of https://jalammar.github.io/illustrated-transformer/ and have spent years since introducing people to Transformers and thinking of how best to communicate those concepts. I've found that different people need different kinds of introductions, and the thread here includes some often cited resources including:

https://peterbloem.nl/blog/transformers

https://e2eml.school/transformers.html

I would also add Luis Serrano's article here: https://txt.cohere.com/what-are-transformer-models/ (HN discussion: https://news.ycombinator.com/item?id=35576918).

Looking back at The Illustrated Transformer, when I introduce people to the topic now, I find I can hide some complexity by omitting the encoder-decoder architecture and focusing only on one. Decoders are great because now a lot of people come to Transformers having heard of GPT models (which are decoder only). So for me, my canonical intro to Transformers now only touches on a decoder model. You can see this narrative here: https://www.youtube.com/watch?v=MQnJZuBGmSQ

There's a lot you can do with the vectors themselves without needing to embed any more text (e.g., clustering, exploration, visualization after dimensionality reduction...etc). Here's a previous embeddings exploration of top HN posts: https://txt.cohere.com/combing-for-insight-in-10-000-hacker-... A lot of that code can be used here as well.

If you want to query for a search term, you can use a trial API key which is free to use for prototyping. The embedding model itself is not open source, though. [co-author of the post here]

Cohere actually trains its own models and they are not based on models from other providers [I work at Cohere].

Your prompt suggestion is a good one for LLMs as a whole. Any information added to the context informs the model and nudges it towards the expected answer format.

For Cohere, make sure you're using Command-Xlarge-Nightly.

Otherwise, you may be prompting a Base LLM expecting the behavior of a different kind of LLM (an instruction-tuned chat model).

Cohere's Command model builds on top of the base model, giving it the capability to follow instructions and user commands.

Hi. Author here. This is the first in a series I've been writing for a while to help orient people about useful perspectives to have in catching up to all that's happening in AI/ML. It's based on what I've seen in the industry and the nlp company I work with (Cohere, where the post is hosted).

This article has the first four points (out of thirteen) that are useful to keep in mind. They are:

1- Recent AI developments are awe-inspiring and promise to change the world. But when?

2- Make a distinction between impressive cherry-picked demos, and reliable use cases that are ready for the marketplace

3- Think of models as components of intelligent systems, not minds

4- Generative AI alone is only the tip of the iceberg

---

The article goes into each one with more detail. Welcoming all feedback and perspectives as we collectively figure out this new frontier.

Agreed. "Stable Diffusion with Diffusers" and "The Annotated Diffusion Model" were excellent and are linked in the article. The code in Diffusers was also a good reference.

I updated the post to say "multi-dimensional array".

In a context like this, we use tensor because it allows for any number of dimensions (while vector/ array is only one, matrix is two). When you get into ML libraries, both popular packages PyTorch and TensorFlow use the "tensor" terminology.

It's a good point. Hope it's clearer for devs with "array" terminology.

Two diffusion processes are involved:

1- Forward Diffusion (adding noise, and training the Unet to predict how much noise is added in each step)

2- Generating the image by denoising. This doesn't predict the final image, each step only predicts a small slice of noise (the removal of which leads to images similar to what the model encountered in step 1).

So it is indeed an iterative processes in that way, each step taking one step towards the final image.

So it really depends on what you use for clustering. In this case, I'm clustering by the original embeddings so the UMAP results are different. I've also seen:

1- Clustering by UMAP. Here the plot would show clean separation of topics. But the clustering algorithm would be working on highly compressed data (from the 1024 dimensions of the embedding down to the 2 of UMAP).

2- BERTopic's approach of doing UMAP down to 5 dimensions, using this dimensionality for clustering, then UMAP again from 5 to 2. Which is an interesting approach.

I've heard people having good results with all three. It's kinda hard to objectively compare, but my leaning was to give the clustering algorithm the representation containing the most information about the text.