- Large Language Models (LLMs) and prompt-based heuristics are being used for off-the-shelf solutions to various NLP problems.
- LLM-based few-shot methods have shown promise but lag in Named Entity Recognition (NER) compared to other methods.
- « PromptNER » is introduced as a new algorithm for few-shot and cross-domain NER.
- PromptNER needs entity definitions and few-shot examples for a new NER task.
- PromptNER uses LLM to generate potential entities and explanations for their compatibility with entity type definitions.
- PromptNER achieves state-of-the-art performance in few-shot NER on ConLL, GENIA, and FewNERD datasets.
- It also outperforms previous methods in Cross Domain NER, setting new records on 3 out of 5 CrossNER domains with an average F1 gain of 3%.
Archives de l’auteur : loic
The complete guide to LLM fine-tuning
Pre-trained large language models (LLMs) offer impressive capabilities like text generation, summarization, and coding out of the box. However, they aren’t universally suitable for all tasks. Sometimes, your LLM might struggle with a specific task. In such cases, one option is to fine-tune the LLM, which involves retraining the base model on new data. Although fine-tuning can be complex, costly, and not the initial solution, it’s a potent technique that organizations using LLMs should consider. Understanding the mechanics of fine-tuning, even if you’re not an expert, can guide you in making informed decisions.
Natural Language Understanding
A free Stanford course
XCS224U
Stanford School of Engineering
This project-oriented course focuses on building efficient and reliable models for understanding human language, drawing from linguistics, natural language processing, and machine learning. It covers tasks like contextual language representation, information retrieval, and NLU model evaluation. The course involves hands-on work to build baseline models and develop original models for class-wide competitions. The second half of the course is dedicated to an individual project in natural language understanding, following best practices in the field and incorporating topics like evaluations, semantic parsing, and grounded language understanding.
https://youtube.com/playlist?list=PLoROMvodv4rOwvldxftJTmoR3kRcWkJBp&si=XsWOdyJY7KhEhDJG
ELI5: FlashAttention
The goal of this blog post is to explain flash attention in such a way that hopefully anyone who already understands attention will ask themselves:
“Why didn’t I think of this before?” followed by “It’s so easy”.
https://gordicaleksa.medium.com/eli5-flash-attention-5c44017022ad
Fine-Tuning Embedding for RAG with Synthetic Data
This repo shows you how to fine-tune an embedding model to improve RAG performance even if you don’t have labelled data (i.e. positive pairs of query/relevant documents).
We walkthrough step-by-step the process of generating a synthetic dataset with LLM, finetuning an opensource embedding model, and finally evaluating the finetuned model.
We experiment with a small scale dataset of financial PDF documents, and show that finetuning the embedding model can substantially improve retrieval performance.
Optimizing LLM latency
- Fastest Inference: mlc stands out as the fastest, prompting a need to assess its quality despite its impressive speed.
- Favorite Tool: CTranslate2 is the preferred choice due to its speed and user-friendliness, supported by excellent documentation. It lacks distributed inference unlike vLLM.
- vLLM Performance: vLLM is also fast but CTranslate outperforms it in speed. However, vLLM supports distributed inference, making it suitable for larger models.
- Text Generation Inference (TGI): An acceptable choice for deploying HuggingFace LLMs traditionally, but not as swift as vLLM. Offers features like telemetry and HF ecosystem integration. Note that TGI’s licensing has become more restrictive as of 7/28/2023, potentially limiting certain commercial uses.
The History of Open-Source LLMs: Better Base Models (Part Two)
https://cameronrwolfe.substack.com/p/the-history-of-open-source-llms-better
- Value of Open-source LLM Research: Aims to democratize influential technology; despite initial struggles and criticism, open-source LLMs gained popularity and significance.
- Early Challenges: Initial open-source LLMs performed poorly and faced criticism, posing difficulties for advancement.
- Transformative Research Line: Focuses on enhancing open-source LLMs, leading to high-performing pre-trained models accessible to all.
- Significance of High-Performing Models: Creation of powerful, cost-effective pre-trained LLMs revolutionized research accessibility.
- Series Overview: Part two of a three-part series on open-source LLM history. The first part explored initial open-source LLM attempts.
- Study Focus: This overview delves into the most popular open-source base models, emphasizing pre-trained models not yet fine-tuned or aligned.
- Future Exploration: Subsequent installment will discuss fine-tuning and alignment of models for diverse practical applications.
Advanced Prompt Engineering
https://cameronrwolfe.substack.com/p/advanced-prompt-engineering
The emergence of large language models (LLMs) has revolutionized problem-solving approaches. In the past, tasks like document reformatting or sentence classification necessitated creating specific computer programs. LLMs have transformed this process, enabling tasks to be accomplished through textual prompts. For instance, reformatting documents can be achieved by instructing an LLM. This shift was exemplified by GPT-3’s ability to achieve accurate results with minimal guidance.
As LLM research progressed, more sophisticated techniques emerged beyond basic prompting methods like zero/few-shot learning. Instruction-following LLMs (e.g., InstructGPT, ChatGPT) prompted investigations into tackling complex tasks. The goal was to extend LLMs beyond simple problems, requiring them to comprehend intricate instructions and execute multi-step reasoning. However, such challenges demand advanced prompting strategies due to their complexity.
Practical Prompt Engineering
https://cameronrwolfe.substack.com/p/practical-prompt-engineering-part
- Prompt engineering: An empirical science focused on optimizing LLM (Large Language Model) performance through various prompting strategies.
- Aims to understand prompting mechanics and employs techniques to enhance LLM capabilities.
- Zero/few-shot learning: A fundamental technique where LLMs perform tasks with minimal or no training examples, showcasing their remarkable adaptability.
- Instruction prompting: Another vital technique involving explicit instructions in prompts to guide LLM behavior.
- Overview intends to impart practical insights and strategies for effective prompt engineering and LLM utilization.
- Provides actionable tricks and takeaways for prompt engineers and LLM practitioners to enhance their effectiveness.
The History of Open-Source LLMs: Early Days (Part One)
https://cameronrwolfe.substack.com/p/the-history-of-open-source-llms-early
- Language modeling research traces back to models like GPT, GPT-2, and pre-transformer methods such as ULMFit.
- GPT-3’s proposal marked the initial rise in popularity by showcasing impressive few-shot learning through self-supervised pre-training and in-context learning.
- The recognition of GPT-3 led to the creation of various large language models (LLMs), including InstructGPT and ChatGPT, sparking widespread interest in generative AI.
- Early LLMs often remained closed source, limiting researchers’ understanding and improvement of their workings.
- Open-source variants of popular language models began to emerge gradually, although they initially lagged behind proprietary models in performance.
- These early open-source models laid the groundwork for increased transparency in LLM research and inspired the development of more potent subsequent models like Falcon and LLaMA-21.
- The overview is part of a three-part series that delves into the history of open-source language models, exploring their beginnings, recent developments, and the application of imitation and alignment techniques to enhance their performance.