If you want to learn about LLMs in just 3 hours, two lectures given by Yann Dubois are just what you need:
Overview of LLM training and post-training:
Scalable LLM evaluation:
If you want to learn about LLMs in just 3 hours, two lectures given by Yann Dubois are just what you need:
Overview of LLM training and post-training:
Scalable LLM evaluation:
A Novel Approach for Efficient Fine-Tuning of Large Language Models
We present Singular Value-Rotation Adaptation with Full Rank (SVRA-FR), a novel method for efficient fine-tuning of large language models. SVRA-FR leverages the full singular value decomposition (SVD) of weight matrices, allowing for comprehensive adjustments through singular value modification and singular vector rotation. This approach offers a parameter-efficient, interpretable, and potentially more effective alternative to existing fine-tuning methods, particularly Low-Rank Adaptation (LoRA).
Large language models have demonstrated remarkable performance across various natural language processing tasks. However, fine-tuning these models for specific tasks remains computationally expensive and often requires significant amounts of data. Recent work on parameter-efficient fine-tuning methods, such as LoRA, has shown promise in reducing these costs. Our work builds upon these approaches by introducing a method that directly manipulates the full SVD components of weight matrices.
SVRA-FR consists of the following key components:
We begin by performing SVD on the original weight matrix W:
W = UΣV^T
where U and V are orthogonal matrices containing left and right singular vectors, respectively, and Σ is a diagonal matrix of singular values. This decomposition allows us to represent the weight matrix in terms of its principal components, with singular values indicating the importance of each component.
SVRA-FR introduces three sets of trainable parameters:
a) Δσ: A vector for adjusting all singular values
b) θ_U: A vector for rotating all left singular vectors
c) θ_V: A vector for rotating all right singular vectors
These parameters allow for fine-grained control over the matrix’s structure and information content.
We modify all singular values:
σ’_i = σ_i + Δσ_i
This adjustment allows us to amplify or attenuate the importance of different components in the weight matrix. By modifying singular values, we can control the « strength » of different features or directions in the weight space.
We apply rotation to all left and right singular vectors:
u’_i = R(θ_U_i)u_i
v’_i = R(θ_V_i)v_i
where R(θ) is a 2D rotation matrix:
R(θ) = [cos(θ) -sin(θ); sin(θ) cos(θ)]
Rotation of singular vectors allows us to adjust the directions of the principal components in the weight space. This can be particularly useful for aligning the model’s features with task-specific requirements without drastically changing the overall structure of the weight matrix.
We reconstruct the adaptation matrix:
W_adapt = U’Σ’V’^T
where U’ and V’ contain the rotated singular vectors and Σ’ is the diagonal matrix of adjusted singular values. This reconstruction combines the effects of singular value adjustments and vector rotations into a single adaptation matrix.
The final weight update is applied additively:
W_new = W + αW_adapt
where α is a scaling factor. This additive update allows us to preserve the original pre-trained weights while incorporating task-specific adaptations.
SVRA-FR differs from LoRA in several key aspects:
For a weight matrix of size m x n, SVRA-FR introduces min(m, n) + m + n trainable parameters, compared to LoRA’s 2r(m+n), where r is the LoRA rank. For large matrices and typical LoRA ranks, SVRA-FR is often more parameter-efficient. This efficiency stems from directly modifying the SVD components rather than introducing separate low-rank matrices.
Unlike LoRA, which uses low-rank matrices, SVRA-FR works with the full SVD, potentially allowing for more comprehensive adaptations. This full-rank approach enables adjustments across the entire weight space, which may be beneficial for tasks requiring fine-grained modifications.
SVRA-FR directly modifies the singular values and vectors of the original matrix, potentially preserving more of the pre-trained structure. This direct manipulation allows for more interpretable changes and may lead to better preservation of the model’s original capabilities.
SVRA-FR offers a novel approach to fine-tuning large language models by directly manipulating their SVD structure. This method combines the efficiency of parameter-efficient fine-tuning techniques with the comprehensiveness of full-rank adaptations. By allowing for targeted adjustments to singular values and rotations of singular vectors, SVRA-FR provides a flexible framework for adapting pre-trained models to specific tasks.
The full-rank nature of SVRA-FR is a key differentiator from methods like LoRA. While this could potentially lead to more comprehensive adaptations, it also raises questions about the trade-off between flexibility and the risk of overfitting. Empirical studies will be crucial to understand these trade-offs across various tasks and model sizes.
Future research directions include:
SVRA-FR represents a promising new direction in efficient fine-tuning of large language models. By leveraging the full SVD structure of weight matrices, it offers a parameter-efficient, interpretable, and flexible approach to model adaptation. While further empirical validation is needed, SVRA-FR has the potential to significantly improve the efficiency and effectiveness of fine-tuning large language models for specific tasks, particularly in scenarios where comprehensive adaptations are beneficial. The method’s ability to directly manipulate the core structure of weight matrices opens up new possibilities for understanding and controlling the adaptation process in deep learning models.
Sources: Loic Baconnier
Safe, interpretable, trustworthy AI, through interactive intelligent visualization, with applications in adversarial machine learning (protecting AI from harm and doing harm), scalable discoveries of deep learning models, and inclusive AI for everyone.
A Must.
Transformer Explainer
Learn How Transformer Models Work with Interactive Visualization
https://poloclub.github.io/transformer-explainer/
Diffusion Explainer
Learn how Stable Diffusion transforms your text prompt into image.
Open Source LLM Tools
If you are looking for useful open-source LLM tools, this is a really useful resource.
It includes different categories like tutorials, AI engineering, and applications, among others. You can also see the # of GitHub stars.

PDF-Extract-Kit, a comprehensive toolkit for high-quality PDF content extraction, including layout detection, formula detection, formula recognition, and OCR.
PDF documents contain a wealth of knowledge, yet extracting high-quality content from PDFs is not an easy task. To address this, we have broken down the task of PDF content extraction into several components:
images, tables, titles, text, etc.;inline formulas and isolated formulas;https://github.com/opendatalab/PDF-Extract-Kit
https://www.perplexity.ai/search/look-at-this-github-https-gith-8ZVtYO.2SA6_q5Vg.VXy.g
BERTopic generates document embedding with pre-trained transformer-based language models, clusters these embeddings, and finally, generates topic representations with the class-based TF-IDF procedure.
https://ritvik19.medium.com/papers-explained-193-bertopic-f9aec10cd5a6
Self-RAG is another form of Retrieval Augmented Generation (RAG). Unlike other RAG retrieval strategies, it doesn’t enhance a specific module within the RAG process. Instead, it optimizes various modules within the RAG framework to improve the overall RAG process. If you’re unfamiliar with Self-RAG or have only heard its name, join me today to understand the implementation principles of Self-RAG and better grasp its details through code.
https://ai.gopubby.com/advanced-rag-retrieval-strategies-self-rag-3e9a4cd422a1
https://llamahub.ai/l/llama-packs/llama-index-packs-self-rag?from=
This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. RAG systems combine information retrieval with generative models to provide accurate and contextually rich responses.
https://github.com/NirDiamant/RAG_Techniques
https://github.com/NirDiamant/RAG_Techniques/tree/main/all_rag_techniques
Perplexica is an open-source AI-powered searching tool or an AI-powered search engine that goes deep into the internet to find answers. Inspired by Perplexity AI, it’s an open-source option that not just searches the web but understands your questions. It uses advanced machine learning algorithms like similarity searching and embeddings to refine results and provides clear answers with sources cited.
Using SearxNG to stay current and fully open source, Perplexica ensures you always get the most up-to-date information without compromising your privacy.
RAG Foundry: A Framework for Enhancing LLMs for Retrieval Augmented Generation
RAG Foundry is a library designed to improve LLMs ability to use external information by fine-tuning models on specially created RAG-augmented datasets. The library helps create the data for training, given a RAG technique, helps easily train models using parameter-efficient finetuning (PEFT), and finally can help users measure the improved performance using various, RAG-specific metrics. The library is modular, workflows are customizable using configuration files.