投稿

RAPTOR: A Novel Tree-Based Retrieval System for Enhancing Language Models – Research Summary

イメージ
RAPTOR: A Novel Tree-Based Retrieval System for Enhancing Language Models – Research Summary This study introduces RAPTOR (Recursive Abstractive Processing for Tree-Organized Retrieval) , a novel tree-based retrieval system designed to enhance search capabilities for extended language models. 1. What is this study about? RAPTOR complements the knowledge of large language models (LLMs) by learning hierarchical representations of text, enabling information retrieval at various levels of abstraction. Specifically, it clusters text chunks and recursively generates summaries to build a tree structure that encompasses everything from an overall summary to detailed information. During search, this tree structure allows for efficient retrieval of information at the appropriate level of granularity based on the query, producing more accurate and comprehensive answers. 2. How does it stand out from previous research? Traditional retrieval-augmented methods typ...

Understanding RAG and Long-Context LLMs: Insights from the SELF-ROUTE Hybrid Approach

イメージ
Understanding RAG and Long-Context LLMs: Insights from the SELF-ROUTE Hybrid Approach Retrieval Augmented Generation (RAG) and Long-Context Large Language Models (LC LLMs) are two key methods for handling long-context information. RAG is efficient and cost-effective, while LC LLMs offer better performance but require more resources. A recent paper, Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach , compares these methods and proposes a hybrid approach called SELF-ROUTE. This approach combines the strengths of both to achieve high performance with lower costs. In this article, we’ll break down the key findings and explain the new hybrid method. What Kind of Research Is This? (Overview) In recent years, large language models (LLMs) such as Gemini and GPT-4 have significantly improved their ability to directly understand long-context inputs. However, retrieval-augmented generation (RAG) remains a notable method...

How to Run stable-diffusion-3.5-large-turbo on Google Colab

イメージ
ow to Run stable-diffusion-3.5-large-turbo on Google Colab stable-diffusion-3.5-large-turbo is a high-precision text-to-image model. This guide will explain how to set up and run the model on Google Colab. Prerequisites Visit Huggingface . To use stable-diffusion-3.5-large-turbo, you need a Huggingface account. If you don’t already have one, please create an account. Once signed up, you’ll see the following screen: Enter the required information, and you’ll gain access to the model immediately. If you wish to download and use the model, you’ll need an access token. Create one from your account page: Navigate to your account page via the profile icon in the upper-right corner, go to the Access Token tab, and create a token by selecting Create new token . Running the Code Install Required Libraries First, install the necessary libraries in Google Colab: ! pip install --quiet -U transformers The -U option updates the library to its latest versio...

Quick Paper Overview: More Agents Is All You Need

イメージ
Quick Paper Overview: More Agents Is All You Need I found this paper fascinating, so I’d like to provide a quick overview of More Agents is All You Need . 1. What’s It About? By leveraging multiple LLMs in a simple sampling-and-voting approach, this study demonstrates significant performance improvements in LLMs. The performance boost is observed across tasks of varying difficulty, with particularly notable gains in more challenging tasks. While both small and large LLMs benefit, smaller models exhibit the most pronounced improvements. This method can also be combined with existing techniques like Chain-of-Thought (CoT), further enhancing performance in certain tasks. 2. What is Differences from Prior Work In previous research, methods like CoT-SC applied voting to diverse answers generated by chain-of-thought prompts, particularly for reasoning tasks. This study, however, explores whether simply increasing the number of agents (LLMs) without relying...

Using Azure OpenAI Service with Local bolt.new

Using Azure OpenAI Service with Local bolt.new bolt.new is an AI-powered full-stack web development platform. It can also be run locally from a GitHub repository. While bolt.new uses Anthropic Claude 3.5 Sonnet by default, this time, we’ll modify it to work with Azure. Implementing Azure When making code modifications, the original code will be retained as comments. Below, only the modified sections of the code are shown, while unchanged original code is abbreviated with “…”. Adding Libraries First, add the necessary library. In bolt.new/package.json , include the @ai-sdk/azure library as follows: { ... "dependencies" : { "@ai-sdk/anthropic" : "^0.0.39" , "@ai-sdk/azure" : "^1.0.5" , // <- Added ... } , ... } Setting Azure Environment Variables First, add the Azure resource name, API key, and deployment name to the bolt.new/.env.local file: ... AZURE_RESOURCE_NAME=Y...

Enabling Application Downloads in Local bolt.new

イメージ
Enabling Application Downloads in Local bolt.new In this article, I will modify bolt.new to allow applications created in the tool to be downloaded locally. This feature will facilitate internal deployment of bolt.new applications, making it particularly useful for corporate environments. Objective Add functionality to download the project files as a ZIP archive. Steps to Implement Integrate a download button in the interface Add a download button in the sidebar or toolbar. Generate a ZIP archive of the project Use a library like JSZip to bundle project files into a ZIP archive. Download the ZIP archive Trigger the browser’s download functionality with the generated ZIP file. Test the feature Ensure that the downloaded ZIP contains the expected files and directory structure. In the next article, we will cover how to modify bolt.new to integrate with Azure OpenAI Service, streamlining the application for enterprise-level use cases. Pl...

Modify the local bolt.new interface to allow input of the API key

イメージ
Modify the local bolt.new interface to allow input of the API key In bolt.new , the API key can be configured using environment variables, but this time, we will modify it to allow input of the API key directly from the interface. Modification Details Sidebar We will enable API key input directly from the sidebar. In the sidebar, which currently displays chat history, we add a new form at the top for entering the API key. To achieve this, modify the file bolt.new/app/components/sidebar/Menu.client.tsx . First, import the function to handle API key input: import { ApiKeyInput } from '~/components/sidebar/ApiKeyInput'; The bolt.new/app/components/sidebar/ApiKeyInput.tsx file will be created later. Next, add a form for entering the API key within the menu. ... return ( <motion.div ref={menuRef} initial="closed" animate={open ? 'open' : 'closed'} variants={menuVariants...

Running bolt.new Locally

イメージ
Running bolt.new Locally Running bolt.new Locally What is bolt.new? bolt.new is an open-source tool for creating web applications. While there is also a web version , this article focuses on how to run it locally. Environment Setup This article will guide you through the steps to run it using WSL (Windows Subsystem for Linux). Installing pnpm First, let’s install pnpm. sudo apt update suto apt install nodejs npm sudo npm -g install n sudo n stable sudo apt purge nodejs npm sudo apt autoremove sudo apt update sudo apt upgrade After restarting the terminal, check if pnpm has been installed successfully. node --version npm --version Downloading bolt.new Next, refer to bolt.new/CONTRIBUTING.md to download the environment from GitHub. git clone https://github.com/stackblitz/bolt.new.git Install the libraries on WSL. cd bolt.new pnpm install Create a .env.local file under the bolt.new folder and specify the Anthropic API key in i...

Using Gemini with the OpenAI Library

イメージ
Using Gemini with the OpenAI Library Based on this article , we can now use Gemini with the OpenAI Library. So, I decided to give it a try in this article Currently, only the Chat Completion API and Embedding API are available. In this article, I tried using both Python and JavaScript. Python First, let’s set up the environment. pip install openai python-dotenv Next, let’s run the following code. import os from dotenv import load_dotenv from openai import OpenAI load_dotenv ( ) GOOGLE_API_KEY = os . getenv ( "GOOGLE_API_KEY" ) client = OpenAI ( api_key = GOOGLE_API_KEY , base_url = "https://generativelanguage.googleapis.com/v1beta/" ) response = client . chat . completions . create ( model = "gemini-1.5-flash" , n = 1 , messages = [ { "role" : "system" , "content" : "You are a helpful assistant." } , { ...

I created a locally running AI bulletin board

イメージ
I created a locally running AI bulletin board I developed a simple AI bulletin board using WebSocket. With this setup, users can experience a virtual bulletin board through AI interactions. Here are the main features: AI-Generated Responses : Using a local LLM (2b), AI-generated responses are created based on different user personas. Since these personas are automatically generated, you can set the number of participants to increase the number of people in the bulletin board simulation. User Post Moderation by AI : Sometimes, users may post emotionally charged messages. By running messages through the AI, users can adjust their content to a more neutral tone before posting. This feature is optional. The full code is available on GitHub . Below, I’ll provide a brief code overview. WebSocket Since multiple AIs are responding simultaneously, I used WebSocket for communication. The server and client are built with FastAPI. The client uses HTML ...