Pubudu Ekanayake (@smewpm) profile picture
Sri Lanka
Joined January 2011
Generative Modeling via Drifting New Kaiming He paper! Instead of a "pushforward" behavior carried out iteratively at inference time, e.g., in diffusion/flow-based models, evolve the pushforward distribution during training naturally enabling 1-step inference. SOTA results on ImageNet 256×256, with FID 1.54 in latent space and 1.61 in pixel space
7
31
1
272
46,345
Pubudu Ekanayake retweeted
vLLM just got a major upgrade! Originally built for autoregressive text-based LLM serving, vLLM-Omni now lets you serve text, image, video, and audio models - all from a single framework. You can also serve diffusion models for fast parallel generation. 100% open-source.
44
232
13
1,327
80,587
Pubudu Ekanayake retweeted
#DeepLearning with PyTorch... 1) Cheat sheet [PDF]: dropbox.com/scl/fi/e4xngykrf… 2) Learn fundamentals with hands-on coding [PDF]: dropbox.com/scl/fi/lfo7r6fnd… 3) #GenerativeAI with Python and PyTorch: amzn.to/4fYjiBn book v/ @PacktDataML
10
118
4
688
40,862
Pubudu Ekanayake retweeted
Here is the inside of an AI Agent: Three core components: 1. Planner - Takes care of breaking down a task into individual steps. It's capable of taking feedback about the plan and generating a new version of it. 2. Evaluator - Takes care of evaluating a plan and providing feedback about it to the Planner component. It can also check the results of a task to determine whether they align with the plan. 3. Executor - Takes care of executing individual steps of a plan. All three components have access to tools and memory to do their job, I'm covering all of this in my course. It starts Monday. You can join at "ml dot school" for lifetime access to the best engineering program you'll take online.
30
57
1
438
42,686
Pubudu Ekanayake retweeted
Replying to @Al_Grigor
Yes, I recently read 90% of AI projects use PyTorch now. Recently put together an PyTorch essentials article: sebastianraschka.com/teachin… (I’ve been an early adopter since 2018 and never looked back; that being said, regarding your points below, TensorFlow also has dynamic graphs, and Keras supports PyTorch as a backend now too)
6
44
1
431
19,166
Pubudu Ekanayake retweeted
Stanford just published a huge 470-page study 📕 "The Principles of Diffusion Models" Explains how diffusion models turn noise into data and ties their main ideas together. It starts from a forward process that adds noise over time, then learns the exact reverse. The reverse uses a time dependent velocity field that tells how to move a sample at each step. Sampling becomes solving a time based equation that carries noise to data along a trajectory. There are 3 views of this idea, variational, score-based, and flow-based, and they describe the same thing. There are also 4 training targets, noise, clean data, score, and velocity, and these are equivalent. Shows how guidance can steer outputs using a prompt or label without extra classifiers. Reviews fast solvers that cut steps while keeping quality stable. Explains distillation methods that shrink many sampling steps into a few by mimicking a teacher model. Introduces flow map models that learn direct jumps between times for fast generation from scratch.
14
179
8
1,114
107,819
Log-linear attention — a new type of attention proposed by @MIT which is: - fast and efficient as linear attention - expressive as softmax It uses a small but growing number of memory slots that increases logarithmically with the sequence length. Here's how it works:
11
204
7
1,378
104,001
Pubudu Ekanayake retweeted
⭐️Introducing the LangGraph Functional API We spent a lot of time making LangGraph's state management (short/long term memory🧠, human in the loop🧑‍🤝‍🧑, time travel⏲️) production ready You can now use these outside of the Graph syntax - with any framework (or none at all!) With the release of the functional API, it is possible to get these features **without having to explicitly define a graph** The functional API allows you to leverage LangGraph features using a more traditional programming paradigm, making it easier to build AI workflows that incorporate human-in-the-loop interactions, short-term and long-term memory, and streaming capabilities. This API is complementary to the Graph API (StateGraph) and can be used in conjunction with it as both APIs use the same underlying runtime. This allows you to mix and match the two paradigms to create complex workflows that leverage the best of both worlds. Blog: blog.langchain.dev/introduci… Video: youtu.be/NXhyWJozM8A
13
60
5
287
33,719
Pubudu Ekanayake retweeted
Combine RAG with reasoning models like o1. Search-o1 modifies the RAG to work with reasoning models like OpenAI o1 or QwQ o,utperforming traditional RAG systems by integrating retrieved information into the Chain of Thought! 👀 Implementation 1️⃣ Choose a Reasoning LLM, e.g. QwQ-32B 2️⃣ Implement a dynamic search mechanism, e.g. special tokens (<|begin_search_query|>) 3️⃣ Reason-in-Documents, Separate LLM call to analyze and refine retrieved information, based on previous reasoning step and user query 4️⃣ Inject “cleaned” knowledge back into the “hold” reasoning chain (<|begin_search_result|>) 5️⃣ Continues the chain of thought reasoning to solve user queries. Insights 🚀 Search-o1 outperforms base models by 4.7% on complex reasoning tasks 🧠 Outperforms human experts in physics (68.7% vs 57.9%) and biology (69.5% vs 68.9%) 📊 Outperforms RAG with 29.6% higher accuracy on multi-hop questions 💡 Reason-in-Documents filters out noise and irrelevant information
3
95
2
389
28,767
When it comes to Mathematics, This is my goto channel. Beginner friendly.
36
497
6
3,929
202,714
Recently, I finally sat down to read the DeepSeek v3 paper (github.com/deepseek-ai/DeepS…). I loved the KV compression proposed by the same group in an earlier paper—it's so elegant! But without explicit mathematical proofs, I found it harder to fully appreciate the underlying idea. So, I drafted a quick math write-up for myself and decided to share it here, in case it helps me clarify any misunderstandings—or helps others in the same boat.
7
69
3
453
61,694
Pubudu Ekanayake retweeted
MegaParse is an open-source tool for parsing various types of documents for LLM ingestion. Supports text, PDF, PowerPoint, excel, csv, and Word documents. It can convert these into a format ideal for LLMs. It can parse content of different types such as tables, TOC, headers, footers, images, etc. I am also building a similar tool and I think the most important feature at the moment is the ability to customize the format of the transformed data as different LLMs prefer different formats.
18
210
6
1,619
120,909
Pubudu Ekanayake retweeted
🎤Paper-to-Podcast Looking for an open-source version of NotebookLM? Paper-to-Podcast is a tool that transforms academic research papers into an engaging and conversational podcast format See the code👇 github.com/Azzedde/paper_to_…
1
106
2
420
25,196
Pubudu Ekanayake retweeted
🚨 Github Trending #1: Flux! The best text-to-image model, completely open-source and free. Download it and try it out!
13
54
1
536
54,882
Pubudu Ekanayake retweeted
Meta just released 4 models today. 🔥 - Meta Chameleon: 7B & 34B language models - Meta Multi-Token Prediction LLM - Meta JASCO: text-to-music models - Meta AudioSeal: audio watermarking model This is based on Meta's groundbreaking paper released back in April-2024 "Better & Faster Large Language Models via Multi-token Prediction" ✨ Original Problem it solves Most LLMs have a simple training objective: predicting the next word. While this approach is simple and scalable, it’s also inefficient. It requires several orders of magnitude more text than what children need to learn the same degree of language fluency. Hence, in this paper the approach is to train language models to predict multiple future words at once—instead of the old one-at-a-time approach. 👉 With this new approach, a 13B parameter models solves 12% more problems on HumanEval and 17 % more on MBPP than comparable next-token models. 👉 And also models trained with 4-token prediction (instead of 1) are up to 3 times faster at inference, even with large batch sizes. 🤯 --- 📌 Under this approach, at each position in the training corpus, we ask the model to predict the following n tokens using n independent output heads, operating on top of a shared model trunk. 📌 The proposed method uses a shared transformer trunk to produce a latent representation of the observed context, which is then fed into n independent output heads to predict the next n tokens in parallel. This factorizes the multi-token prediction cross-entropy loss into terms for each future token conditioned on the latent representation. 📌 To make the architecture memory-efficient, the forward and backward passes are carefully reorganized. After the forward pass through the shared trunk, each output head's forward and backward passes are computed sequentially, accumulating gradients at the trunk. This avoids materializing all logits and gradients simultaneously, reducing peak memory usage from O(nV + d) to O(V + d) without impacting runtime. 📌 During inference, the additional output heads can be leveraged for self-speculative decoding methods like blockwise parallel decoding and Medusa-like tree attention to speed up generation by up to 3 times, even with large batch sizes. 📌 Experiments show that multi-token prediction is increasingly useful for larger model sizes, with 13B parameter models solving 12% more problems on HumanEval and 17% more on MBPP compared to next-token models. The approach remains beneficial when training for multiple epochs. 📌 Finetuning multi-token prediction models on the challenging CodeContests dataset outperforms finetuning next-token models, demonstrating the rich representations learned during pretraining. Next-token finetuning on top of multi-token pretraining appears optimal. 📌 For natural language tasks, multi-token prediction improves performance on generative benchmarks like summarization, while not significantly regressing on standard benchmarks based on multiple choice questions and negative log-likelihoods. 📌 The authors hypothesize that multi-token prediction mitigates the distributional discrepancy between training-time teacher forcing and inference-time autoregressive generation. They provide an information-theoretic decomposition showing how multi-token prediction increases the importance of tokens relevant for the continuation of the text.
16
195
10
854
78,065
Pubudu Ekanayake retweeted
🕸️Introducing GraphRAG with LangChain and Neo4j Great introduction to using Graphs - instead of pure vector DBs - to power RAG applications The relationships that graphs provide can empower better retrieval which can yield better answers medium.com/microsoftazure/in…
8
114
6
554
50,596
Pubudu Ekanayake retweeted
KAN: Kolmogorov–Arnold Networks is a really elegant paper. It's refreshing to see that things worked by design rather than by accident in ML. I made a small KAN experiment comparing it to MLP and spline fitting. (notebook in comments!)
26
335
23
2,295
329,295
Pubudu Ekanayake retweeted
Nice Paper for a Sunday read - "A Primer on the Inner Workings of Transformer-based Language Models" 📌 Provides a concise technical introduction focusing on the generative decoder-only architecture. 📌 The paper introduces the Transformer layer components, including the attention block (QK and OV circuits) and feedforward network block, and explains the residual stream perspective. It then categorizes LM interpretability approaches into two dimensions: localizing inputs or model components responsible for a prediction (behavior localization) and decoding information stored in learned representations to understand its usage across network components (information decoding). 📌 For behavior localization, the paper covers input attribution methods (gradient-based, perturbation-based, context mixing) and model component importance techniques (logit attribution, causal interventions, circuits analysis). Causal interventions involve patching activations during the forward pass to estimate component influence, while circuits analysis aims to reverse-engineer neural networks into human-understandable algorithms by uncovering subsets of model components interacting together to solve a task. 📌 Information decoding methods aim to understand what features are represented in the network. Probing trains supervised models to predict input properties from representations, while the linear representation hypothesis states that features are encoded as linear subspaces. Sparse autoencoders (SAEs) can disentangle superimposed features by learning overcomplete feature bases. Decoding in vocabulary space involves projecting intermediate representations and model weights using the unembedding matrix. 📌 The paper then summarizes discovered inner behaviors in Transformers, including interpretable attention patterns (positional, subword joiner, syntactic heads) and circuits (copying, induction, copy suppression, successor heads), neuron input/output behaviors (concept-specific, language-specific neurons), and the high-level structure mirroring sensory/motor neurons. Emergent multi-component behaviors are exemplified by the IOI task circuit in GPT2-Small. Insights on factuality and hallucinations highlight the competition between grounded and memorized recall mechanisms.
4
60
3
366
43,591
Pubudu Ekanayake retweeted
Why cosine-similarity and its implications for high dimensionality are so important for text embeddings in LLM ? 💡 📌 Cosine similarity measures the cosine of the angle between two vectors, giving us a value between -1 and 1. For unit vectors (vectors normalized to have a magnitude of 1), this is equivalent to their dot product. A cosine similarity of 0 implies orthogonality (no correlation), 1 implies identical direction, and -1 implies exactly opposite directions. Goldstein, Studer (arXiv: 1610.07531, 2016) showed in their research - that as the dimensionality of the space increases (d gets larger), the bounds on the expected value of the cosine similarity between two random vectors get tighter around 0. This is proportional to 1/sqrt(d), where d is the dimension. 📌 In simpler terms, in very high-dimensional spaces, most pairs of random vectors are nearly orthogonal to each other (cosine similarity close to 0). This tightening around zero is more pronounced as the number of dimensions increases. This is an important concept in high-dimensional geometry: as the dimensionality increases, the angle between random vectors tends to become orthogonal The 1/sqrt(d) term shows that the deviation from zero decreases at a rate inversely proportional to the square root of the dimensionality. 📌 So in a high-dimensional space (like those used for embeddings), most vector pairs (representing different items or concepts) will not be similar (i.e., their cosine similarity will be close to 0). Only a few will show significant similarity (cosine similarity notably greater than 0). 📌 This implies that only vectors (embeddings) that are truly similar will stand out with a higher cosine similarity. This sparsity of high similarities is beneficial for tasks like semantic search, where you want to retrieve only the most relevant documents or items. 📌 Recent OpenAI embeddings are 1536-dimensional The higher the dimensionality, the more nuanced the representation can be. With 1536 dimensions, the model can encode a vast array of features or aspects of the data. 📌 This orthogonality in a high-dimensional space like 1536 dimensions ensures that the embeddings can capture a wide variety of different features or aspects of the data without those features overlapping too much. It means that the embeddings can represent a vast range of different concepts or entities distinctly.
4
37
2
177
16,046