Purak Jain (@PurakJain) profile picture

Engineer; Researcher | Marketing Science

Seattle, WA
Joined June 2017
Purak Jain retweeted
today i learned something very interesting at ICLR, a term called order of evidence. During RAG, we send the top retrieved documents as evidences and prompting them to LLMs. Normally prompting is based on cosine similarity: top match always being prompted first. However, different LLMs might have difference "preference" on the order of evidence: 1. ChatGPT prefers top evidence, which is good. 2. GPT4 has no preference on evidence order, which means the similarity score is not being considered, you only need to decide top-K, and all evidences will be equally treated. 3. Surprisingly, Llama2 and PaLM prefers last order evidence, so you need to reverse the rank list then prompt to the LLM :) arxiv.org/pdf/2305.13300
13
50
4
319
44,099
Purak Jain retweeted
Summarizing meeting notes and action items is compounding. AI can augment these skills and reduce overhead. Today, I’m open-sourcing a simple app my team has built (with help from Q) to summarize our discussions and track deliverables: allthingsdistributed.com/202… #Bedrock #AmazonQ
14
46
9
173
37,696
Purak Jain retweeted
A long-suspected theory: LSTMs are superior to Transformers but we didn't know how to scale them as well — so Transformers pulled ahead because they were easier to scale. Enter xLSTM... very interesting work. Key diagrams below
I am so excited that xLSTM is out. LSTM is close to my heart - for more than 30 years now. With xLSTM we close the gap to existing state-of-the-art LLMs. With NXAI we have started to build our own European LLMs. I am very proud of my team. arxiv.org/abs/2405.04517
4
66
4
434
53,613
Purak Jain retweeted
I come back to this a lot
11
35
281
35,189
Purak Jain retweeted
github.com/google-research/t… Yes. Yes!!!! Everyone read this material three times!
Has someone created materials around “fundamentals of ML for AI Engineers”, not focused on building models but things like evaluations, error analysis, etc Maybe something already exists? I don’t want to do it lol - looking for a resource I can share with people
5
83
2
607
109,777
gave a talk at last week's Stanford MLSys seminar about evaluating LLM pipeline output quality, especially for custom tasks at scale: youtube.com/watch?v=eGVDKegR… if your lab is interested in data management x LLMs x HCI, i would love to give this talk & get your feedback! 🙏
3
21
151
19,027
i think there were actually like 30 delivered but here there are arc.net/folder/D0472A20-9C20…
9
123
8
1,401
104,952
since I'm deeply immersed in evals right now (and the process of building them) I got a kick out of this paper from @sh_reya @jdzamfi @bjo3rn @adityagp @IanArawjo it addresses the challenge of time-efficiently coming up with evals that are aligned with practitioners some thoughts:
1
18
67
12,851
I've written up my study group lectures on implementing Transformers in PyTorch into a blog series: Creating Transformers from Scratch: - Part 1: The Attention Mechanism benjaminwarner.dev/2023/07/0… - Part 2: The Rest of the Transformer benjaminwarner.dev/2023/07/2…
7
253
7
1,325
185,638
hard launching a new HCI paper on LLM evals tomorrow 🚀 (tldr: coming up with custom evals you can trust is _really_ hard, and our paper shares a number of reasons for why)
10
7
182
27,945
This video from @UmerHAdil is *the* best resource I've seen for learning OpenAI Triton -- and one of the best deep tech tutorials of any kind I've seen. youtube.com/watch?v=DdTsX6DQ…
8
108
891
87,480
I'm teaching spatial, stochastic simulation in my #DataAnalytics course. To help my students make the leap from spatial estimation to spatial simulation I built out this #Python @matplotlib dashboard with my sequential Gaussian simulation codes on #GitHub @ github.com/GeostatsGuy/DataS… ∀. Students learn by playing with #DataScience methods!
8
198
3
1,096
80,720
LLM app development is rate-limited by quality evals. There's a paradox of LLM, prompt, etc choice. Recently put together a short guide on setting up custom evals. Playlist (5 min vids): youtube.com/playlist?list=PL… Code: github.com/langchain-ai/lang… teapawt.net/LangChainAI/status/177…
LangSmith Evaluations With the rapid pace of AI, developers are often faced with a paradox of choice: how to choose the right prompt, how to trade-off LLM quality vs cost? Evaluations can accelerate development with structured process for making these decisions. But, we've heard that it is challenging to get started. So, we are launching a series of short videos focused on explaining how to perform evaluations using LangSmith. 1. Why Evals Matter Lays out 4 general considerations for evaluation: (1) dataset, (2) evaluator, (3) task, (4) how to apply eval to improve your product (e.g., unit tests, A/B tests, etc). 📽️: youtu.be/vygFgCNR7WA 📓: docs.smith.langchain.com/eva… 2. Evaluation Primitives Introduces the primary components of LangSmith evaluation, including tracing (along with metadata, feedback, tags), datasets, and evaluators. 📽️: youtu.be/OuFUy45RsHU 📓: docs.smith.langchain.com/tra… 3. Dataset Creation: Manual curation Users often want to build custom eval sets (e.g., of QA pairs for RAG, or prompt-expected response pairs). This shows how to create, edit, and version your own evaluation dataset using the LangSmith SDK. 📽️: youtu.be/N9hjO-Uy1Vo 📓: docs.smith.langchain.com/eva… 4. Dataset Creation: From Logs Users often want to capture user logs as good and / or challenging examples to re-test their application on. This shows how to create datasets directly from logs (e.g., user interactions with your app that are captured in LangSmith). 📽️: youtu.be/hPqhQJPIVI8 📓: docs.smith.langchain.com/eva… 5. Evaluators: Pre-built Users often want to quickly get started with eval; for this you can use many of LangSmith's pre-built evaluators (e.g., that use LLM-as-a-judge) for tasks such as RAG (question answering), evaluating LLM output based upon user-supplied criteria, etc. 📽️: youtu.be/y5GvqOi4bJQ 📓: docs.smith.langchain.com/eva… 6. Evaluators: Custom Users often want to define custom evals that are domain specific to a particular app. This shows how to define your own custom evaluation logic in LangSmith. 📽️: youtu.be/w31v_kFvcNw 📓: docs.smith.langchain.com/eva… 7. Eval comparisons Once a user has run a few different experiments, it is common to compare results (both using metrics and with manual inspection of the examples that show the most difference). This shows how to compare results of multiple experiments in the LangSmith UI, using review of traces to inspect run outputs or the grader decisions. 📽️: youtu.be/kl5U_efgK_8 📓: docs.smith.langchain.com/use… Notebook used in videos: github.com/langchain-ai/lang…
1
31
2
158
30,421
Purak Jain retweeted
Prototyping is easy. Shipping high-quality systems is hard. One of the most helpful papers for AI practitioners is @sh_reya et al. “Operationalizing ML: an interview study.” Lots of learnings from many teams are distilled into a single paper arxiv.org/abs/2209.09125
1
26
3
192
25,947
RAG From Scratch Here's a set of short (5-10 min videos) and notebooks explaining > a dozen of my favorite RAG papers. Took a stab at implementing each idea myself (all code open source) and grouped according to the diagram. Repo: github.com/langchain-ai/rag-… Video playlist: youtube.com/playlist?list=PL… Some highlights: Is RAG Really Dead? How RAG might change with long context LLMs. Video: youtube.com/watch?v=SsHUNfhF… Adaptive-RAG Dynamically route queries based on complexity to different RAG approaches. Implemented in LangGraph w/ @cohere cmd-R. Video: youtu.be/04ighIjMcAI Code: github.com/langchain-ai/lang… Paper (@SoyeongJeong97 et al): arxiv.org/abs/2403.14403 Corrective-RAG Self-correct retrieval errors in-the-loop unit tests for doc relevance and fallback to web-search. I implemented in LangGraph w/ @MistralAI-7b + @ollama for running locally. Video: youtube.com/watch?v=E2shqsYw… Code: github.com/langchain-ai/lang… Paper (@Jiachen_Gu et al): arxiv.org/pdf/2401.15884.pdf Self-RAG Self-correct RAG errors with in-the-loop unit tests for doc relevance, answer hallucinations, and answer quality. Implemented in LangGraph w/ @MistralAI-7b + @ollama for running locally. Code: github.com/langchain-ai/lang… Code (local): github.com/langchain-ai/lang… Paper (@AkariAsai et al): arxiv.org/abs/2310.11511.pdf Query Routing Various approaches for directing questions to the correct datasource (e.g., logical, semantic, etc). Video: youtu.be/pfpIndq7Fi8 Code: github.com/langchain-ai/rag-… Query Structuring Use an LLM to convert from natural language-to-<DSL> where DSL is a domain specific language required to interact with a given database (SQL, Cypher, etc). Video: youtu.be/kl6NwWYxvbM Code: github.com/langchain-ai/rag-… Blog: blog.langchain.dev/query-con… 2/ Deep dive on graphDBs (c/o @neo4j): blog.langchain.dev/enhancing… 3/ Query structuring docs: python.langchain.com/docs/us… 4/ Self-query retriever docs: python.langchain.com/docs/mo… Multi-Representation Indexing Use an LLM to produce document summaries ("propositions") that are optimized for retrieval. Embed these summaries for similarity search, but return full documents to the LLM for generation. Video: youtu.be/gTCU9I6QqCE Code: github.com/langchain-ai/rag-… Paper (@tomchen0 et al): arxiv.org/pdf/2312.06648.pdf RAPTOR Cluster docs in the corpus and summarize similar ones recursively. Index them all together, resulting in lower-level docs and summaries that can be retrieved to answer questions that span detailed-to-higher level. Video: youtu.be/z_6EeA2LDSw Code: github.com/langchain-ai/lang… Paper (@parthsarthi03 et al): arxiv.org/pdf/2401.18059.pdf ColBERT Improve embedding granularity w/ a contextually influenced embedding for each token in the document and query. Video: youtu.be/cN6S0Ehm7_8 Code: github.com/langchain-ai/rag-… Paper (@lateinteraction & @matei_zaharia): arxiv.org/abs/2004.12832 Multi-Query Re-write the user question from multiple perspectives, retrieve documents for each re-written question, return the unique documents for all queries. Video: youtube.com/watch?v=JChPi0CR… Code: github.com/langchain-ai/rag-… Paper: arxiv.org/pdf/2305.14283.pdf RAG-Fusion Re-write the user question from multiple perspectives, retrieve documents for each re-written question, and combine the ranks of multiple search result lists to produce a single, unified ranking w/ Reciprocal Rank Fusion (RRF). Video: youtube.com/watch?v=77qELPbN… Code: github.com/langchain-ai/rag-… Repo (@Raudaschl): github.com/Raudaschl/rag-fus… Decomposition Decompose a question into a set of sub-problems / questions, which can either be solved sequentially (use the answer from first + retrieval to answer the second) or in parallel (consolidate each answer into final answer). Various works such as Least-to-Most prompting (@denny_zhou et al) and IR-CoT present ideas that be utilized. Video: youtube.com/watch?v=h0OPWlEO… Code: github.com/langchain-ai/rag-… Papers: arxiv.org/pdf/2205.10625.pdf arxiv.org/pdf/2212.10509.pdf Step-back prompting First prompt the LLM to ask a generic step-back question about higher-level concepts or principles, and retrieve relevant facts about them. Use this grounding to help answer the user question. Video: youtube.com/watch?v=xn1jEjRy… Code: github.com/langchain-ai/rag-… Paper (@denny_zhou + colleges): arxiv.org/pdf/2310.06117.pdf HyDE LLM to convert questions into hypothetical documents that answer the question. Use the embedded hypothetical documents to retrieve real documents with the premise that doc-doc similarity search can produce more relevant matches. Video: youtube.com/watch?v=SaDzIVkY… Code: github.com/langchain-ai/rag-… Paper: arxiv.org/abs/2212.10496
26
262
13
1,080
118,688
The most dangerous modern diseases aren't: Depression. Obesity. ADHD. This one disease is the worst. And it causes the three above. Here it is (and how to protect yourself):
Readers added context they thought people might want to know
This thread heavily pulls on pseudoscience with the intention of selling users supplements with little pharmacological effect. It relies on the teachings of Andrew Huberman, many of which have been examined and generally concluded to be misleading or even harmful. slate.com/technology/202… mcgill.ca/oss/article/cr… kstarr.com/huberman-bro-s…
199
3,540
145
14,666
4,972,303
Andrej Karpathy talking about - - rarity of talents in distributed computing with GPUs. - the opportunities in computer architecture because von Neumann architecture may not be optimal - progress in precision - sparsity in neural networks
6
134
13
1,063
155,194
Purak Jain retweeted
17
61
4
748
141,555
Purak Jain retweeted
One of the most imaginative LLM papers I've read in a while: use evolution to merge models from HuggingFace to unlock new capabilities, such as Japanese understanding. It's a form of sophisticated model surgery that requires much smaller compute than traditional LLM training. By none other than @hardmaru, who proposed many inspiring "meta techniques" like HyperNet and weight-agnostic NN. There're only 2 methods that scale indefinitely with compute: learning & search (@RichardSSutton, the Bitter Lesson). The foundation model community is focusing almost exclusively on learning, but has not put much emphasis on search. I believe the latter has immense potential both in training (evolutionary algorithms) and inference (AlphaGo-style search) phases. Links in comment.
26
261
13
1,348
180,376
Purak Jain retweeted
I’m the CEO of a $100 million business. But the first 10 years of my career: • Rejected by Google (2x) • Fired by FB after 9 months • Built 10+ startups that didn’t work out Here are 18 pieces of brutally honest career advice (I wish I knew earlier):
117
349
35
3,558
1,610,870