LLMs finetuned on specific data often fail to generalize to related unseen information, like logical reversals.
This @GoogleDeepMind paper shows In-Context Learning's superior generalization can improve finetuning.
It proposes enriching the training dataset to achieve this.
Methods Explored in this Paper 🔧:
→ The core method uses a LLM's In-Context Learning capability to generate diverse new examples from existing training data.
→ These include rephrasings, logical reversals, and syllogistic inferences, making implicit knowledge explicit.
→ Adding these to finetuning data significantly boosts generalization, e.g., near-ceiling accuracy on reversal tasks versus ~0 percent from standard finetuning.
→ Splitting multi-sentence documents into individual items can further improve augmentation benefits.
📌 In-context learning bootstraps finetuning, transferring flexible reasoning to model weights.
📌 Augmentation turns strong in-context learners into powerful, efficient data synthesizers for finetuning.
📌 This bridges systematic generalization gaps between prompting and finetuning methods effectively.
----------------------------
Paper - arxiv. org/abs/2505.00661v1
Paper Title: "On the generalization of language models from in-context learning and finetuning: a controlled study"
Here’s a great guide teaching you how to construct knowledge graphs using LLMs that adhere to a pre-defined schema - using purely local models (@ollama, @huggingface), and @neo4j as the graph store.
Possible with @llama_index! 🦙🕸️
1. Define the set of possible entities and relations (e.g. person/place/organization, has/part of/worked on). Define a validation schema to enforce that certain entities have relations.
2. Enter this schema in our `SchemaLLMPathExtractor` to extract out a graph from each unstructured chunk (using Llama3 on @ollama). Since the set of entities is already pre-constrained, you worry less about entity disambiguation across chunks.
3. Query the constructed KG and view the extracted relationships!
Big shoutout to @LoganMarkewich and @neo4j folks for the help.
Notebook: https://t.co/scPHYBGNPU
Before you build complex agent systems, I’d recommend building with the individual “agent ingredients” first to gain a better first principles understanding of how they work.
Here are the main ingredients for building an agent (mini 🧵)
Query Planning: Given the task + surrounding context, decompose it into a series of steps (chain-of-thought, DAG, tree). Can be represented as a simple prompt call with structured outputs.
Memory: Store state across user tasks, to better inform the next task. Important for any chatbot!
Tool Use: Use the LLM to make API calls to any external system. This could be a vector db (through auto-retrieval). This could also be calling an external API (Slack, Gmail, Calendar)
Using each ingredient on its own gives you more limited capability but is much more efficient in terms of cost and latency. It also gives you the ability to compose your own complex pipelines without the need to use out of the box agents.
Others include reflection, async task execution, debuggability, etc.
You can build this with @llama_index. Linking resources below:
Slides on agents: https://t.co/gkRaqTkU6P
Routing: https://t.co/ZiY4JWTFcM
Query Planning: https://t.co/ivBmjPkTMd
Conversation Memory: https://t.co/qhYY5tMxut
Tool Use example (function calling with @MistralAI): https://t.co/A8uH0feEGJ
Tool Use example (auto-retrieval): https://t.co/ipHlFBZbL5
Building custom agent: https://t.co/vyGtpplbSl
RAGのサーベイ論文。「pre-検索、検索、post-検索、生成」の4つの切り口で手法を分類(図引用)。RAGアプリケーショの改善手法やアイデアを探している場合はチェックしてみると良さそう。
A Survey on Retrieval-Augmented Text Generation for Large Language Models
https://t.co/DqZy2Qwvts