發佈日期:

Retrieval-Augmented LLMs

檢索增強生成(RAG)的工作流程

從使用者查詢開始,透過向量資料庫檢索,到填入提示,最終形成回答的整個過程。

RETA-LLM框架可以看作是實現RAG目標的一種具體實現方式,它提供了一套模組化的工具和方法來將外部知識整合到語言模型中,以提升其產生答案的能力。

RETA-LLM Framework

研究論文: https://arxiv.org/pdf/2306.05212v1

過去通用的LLM增強工具包(如LangChain)與RETA-LLM有所不同,RETA-LLM專注於檢索增強LLMs,並提供更多的插件模組。

檢索增強LLMs使用兩個模組的檢索和生成策略:

  • 根據用戶的請求檢索文件或段落(文件檢索模組)
  • 利用這些相關文件作為參考生成答案(答案生成模組)。

除了這兩個基本模組外,RETA-LLM還提供了三個可選模組:

  • 請求重寫模組,以使用戶當前的請求更完整和清晰
  • 萃取模組,從檢索到的整個文件內容中提取相關段落或片段
  • 事實檢查模組,以驗證生成答案中是否存在事實錯誤

這些可選模組可以使IR系統和LLMs之間的交互更加有效和順暢。RETA-LLM中LLMs和IR系統之間的解綁更加徹底,這使得搜索引擎和LLMs的定制更加方便。

RETA-LLM的框架圖

RETA-LLM的工作流程如下:

  • 使用請求重寫模組修改目前使用者請求,使其完整且清晰。 由於使用者可能向RETA-LLM提出一系列問題,目前使用者請求的語意可能不完整。 例如,使用者可能會問「經濟學院怎麼樣?」而歷史請求是「介紹資訊學院的專業」。 在這種情況下,使用者的準確意思是「介紹經濟學院的專業」。 由於LLMs在對話式密集檢索中顯示出出色的重寫查詢能力,RETA-LLM將當前使用者請求和先前的對話歷史提供給LLMs進行重寫。
  • 然後,RETA-LLM使用文件檢索模組根據修訂後的使用者請求從外部語料庫中檢索相關文件。 文檔檢索模組是與IR系統連接的模組。 它從外部知識語料庫中檢索相關文件並傳回前K個。 。
  • 接下來,RETA-LLM使用段萃取模組從檢索到的文件中提取與使用者請求相關的片段,以形成參考文獻。 由於LLMs的輸入長度限制(通常為2048或4096個標記),因此不可能直接將所有前K個相關文件內容連接起來作為它們產生答案的參考文獻。 透過截斷文件內容的瑣碎方法可能會遺失其中的重要資訊。 因此,RETA-LLM重複使用LLMs自身從修訂後的請求中提取相關片段。 由於一個文件的長度也可能超出限制,RETA-LLM採用滑動視窗策略逐步擷取片段。 在我們的預設配置中,滑動視窗大小和步長設定為512和256。 然後,這些片段被連接在一起作為參考文獻。
  • 此外,RETA-LLM使用答案產生模組為使用者請求產生答案。 如同先前的研究所建議的,透過提供來自外部語料庫檢索到的參考文獻,LLMs可以產生更準確的答案。
  • 最後,RETA-LLM使用事實檢查模組驗證產生的答案是否包含事實錯誤,並為使用者要求輸出最終回應。 儘管提供了產生的額外證據,LLMs也可能出現幻覺。 有必要設計一個模組進行進一步的事實驗證。 由於LLMs具有強大的自然語言理解能力,我們將參考文獻和生成的答案提供給它們進行判斷。 因此,RETA-LLM可以決定是否輸出產生的答案,或只是說「我無法回答這個問題」。

請注意,LLMs的所有輸入都包含在指示或提示中。 如圖1所示,在RETA-LLM中完全解開了IR系統和LLMs之間的連結。 我們RETA-LLM中的這種分離設計使用戶可以自訂自己的個人搜尋引擎和LLMs。

知識檢索的過程

  • 內建工具增強助手功能: 內建的工具可以將上傳的文件中的外部知識與助手功能結合起來,使助手能夠存取並利用這些外部知識來回答使用者的問題。
  • 內容分塊、索引和嵌入儲存: 上傳的檔案內容將被分成區塊,然後進行索引和嵌入儲存。 這意味著文件內容將被切割成較小的片段,每個片段都會被賦予一個特定的標識,並且會轉換成向量表示,以便更有效地處理和檢索。
  • 檢索嵌入以回答輸入查詢: 當使用者提出查詢時,系統會將檢索嵌入的向量表示以尋找與查詢相關的內容區塊。 這些內容區塊中包含的知識將被用來回答使用者的查詢,以提供更準確和全面的答案。

RAG的挑戰

  • 檢索模型: 選擇合適的檢索模型是一項挑戰。 不同的檢索模型可能適用於不同的場景,因此需要仔細選擇以確保檢索的效果和效率。
  • 稠密或稀疏表示: 在RAG中,可以使用稠密或稀疏的表示來表示檢索到的內容。 稠密表示通常具有更高的維度和更多的信息,但也可能更加計算密集。 稀疏表示則可能更加高效,但可能會遺失某些細節資訊。
  • 內容區塊的單位: 將內容分成適當的區塊是一個挑戰。 區塊的大小和粒度會影響到檢索和處理的效率,因此需要找到一個合適的單位來平衡資訊的完整性和處理的複雜性。
  • 類似的參考引入噪音: 當有多個相似的參考資料時,可能會引入噪音,使系統難以確定哪個參考是最相關的。 這可能會影響答案的準確性和一致性。
  • 有些問題需要跨文件引用來回答: 某些問題可能需要引用多個文件中的資訊才能進行回答。 這增加了檢索和整合資訊的複雜性,需要係統能夠有效地處理跨文件的引用和關聯資訊。
發佈日期:

提示工程框架的概念

明確具體的提問

  • 請求模型採用一個人物角色
  • 使用分隔符清楚地指示輸入的不同部分
  • 指定完成任務所需的步驟
  • 提供示例
  • 指定輸出的期望長度

以下為一個範例

In-Context Learning和Chain-of-Thought

  • In-Context Learning(上下文學習): 這是指模型在學習和處理文字時能夠考慮上下文資訊的能力。 在上下文學習中,模型不僅僅關注單字或短語的訊息,而是根據前後文的內容來理解當前文本的含義。 這種能力使得模型能夠更好地理解文本的語境,從而產生更準確和連貫的輸出。
  • Chain-of-Thought(思維鏈): 這指的是模型在生成文本時能夠保持連貫性和邏輯性的能力。 在思維鏈中,模型可以根據前面產生的內容來決定後續產生的內容,並保持文字的一致性和邏輯性。 這種能力使得模型能夠產生更連貫和有意義的文字輸出。
圖片來源: https://arxiv.org/pdf/2205.11916.pdf

Tree-of-Thoughts思維樹

思考樹(ToT)是一種透過將複雜問題分解為更易於解決的小問題,為LLM推理提供了更結構化的提示框架。

與在鏈中推理的CoT不同,ToT以樹的形式組織其解決問題的策略。每個節點都被稱為“思維”,是一個連貫的語言序列,是通往最終答案的一步。

透過將問題劃分為離散的「思想」單元——從填字遊戲中的一系列簡短單字到數學方程式的一個組成部分——ToT確保問題的每個階段都得到系統的解決。

圖片來源: https://arxiv.org/pdf/2305.10601.pdf

在「oracle模式」下,ToT的表現比CoT還要好

發佈日期:

準備微調用的資料集

LLM的訓練過程

以下是LLM訓練過程的圖

NLP 數據集可用於演示各種 NLP 任務,例如:

  • 情感分析
  • 分類
  • 命名實體識別
  • 機器翻譯

NLP 數據集可用於為 NLP 模型提供輸入和輸出。

  • 輸入:NLP 數據集可用於為模型提供訓練數據。這可以幫助模型學習如何執行特定任務。
  • 輸出:NLP 數據集可用於評估模型的性能。這可以幫助確定模型是否有效以及如何改進模型。

整理 NLP 數據集的步驟

  1. 收集數據:首先,您需要收集要使用的數據。數據可以來自各種來源,例如互聯網、書籍或其他媒體。
  2. 清理數據:一旦收集了數據,就需要清理數據。這包括刪除不需要或錯誤的數據,以及糾正任何錯誤或不一致之處。
  3. 預處理數據:接下來,您需要預處理數據。這包括將數據轉換為格式,以便模型可以輕鬆處理它。這可能包括將文本轉換為數字表示、分段句子或刪除停用詞。
  4. 標註數據:對於某些 NLP 任務,您需要標註數據。這意味著將正確的答案或標籤分配給每個數據點。
  5. 拆分數據:最後,您需要將數據拆分成訓練、驗證和測試集。訓練集將用於訓練模型,驗證集將用於評估模型在訓練過程中的性能,測試集將用於評估模型的最終性能。

簡單的範例程式碼

import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer

# Load text data
text_data = ["This is a sample text.", "Another text sample.", ...]

# Preprocess text data (e.g., remove special characters, convert to lowercase)
preprocessed_text = [t.strip().lower() for t in text_data]

# Tokenize text data
tokenized_text = [t.split() for t in preprocessed_text]

# Vectorize tokenized text using TF-IDF
vectorizer = TfidfVectorizer(max_features=5000)
X = vectorizer.fit_transform(tokenized_text)

# Assign labels to the vectorized data (e.g., sentiment analysis, classification)
y = ...

# Create a Pandas DataFrame with the preprocessed data and labels
df = pd.DataFrame({'text': preprocessed_text, 'label': y})

# Save the dataset to a file or database for future use
df.to_csv('nlp_dataset.csv', index=False)

用於整理 NLP 數據集的工具和資源

  • NLTK:NLTK(Natural Language Toolkit)是一個廣泛使用的 Python 庫,用於自然語言處理。它包含許多用於數據清理、預處理和標註的工具。NLTK 文檔: https://www.nltk.org/book/
  • spaCy:spaCy 是另一個流行的 Python 庫,用於自然語言處理。它包含許多用於數據清理、預處理和標註的工具。spaCy 文檔: https://spacy.io/
  • Stanford CoreNLP:Stanford CoreNLP 是由斯坦福大學開發的一個 Java 庫,用於自然語言處理。它包含許多用於數據清理、預處理和標註的工具。Stanford CoreNLP 文檔: https://github.com/stanfordnlp/CoreNLP
發佈日期:

基於神經網路的語言模型

基於神經網路的語言模型

基於神經網路的語言模型是一種利用深度學習技術,特別是透過循環神經網絡(RNN)或注意力機制(Transformer)的模型,來處理自然語言文本並生成下一個詞彙的模型。相較於傳統的方法,這種模型具有以下特點:

  1. 直接學習預測下一個詞彙: 這些模型直接從大量的文本資料中學習,不需要手動設計特徵或規則。它們通過觀察先前的詞彙序列,學習預測接下來的詞彙。
  2. 利用詞彙相量表徵語意資訊: 在進行預測時,這些模型使用詞彙的向量表示,這些向量捕捉了詞彙之間的語意關係。這使得模型能夠捕捉到詞彙之間的語義相似性,而不僅僅是單純的字符匹配。
  3. 克服死板的字符匹配: RNN和Transformer網絡並不僅僅是計算連續N個詞彙的頻率,它們能夠捕捉到更複雜的詞彙之間的關係,包括不同詞彙之間的語義相似性和語境相依性。
  4. 減少稀疏性: 由於詞彙向量化,模型能夠減少稀疏性,從而可以從有限的資料中學習到更豐富的詞彙組合和上下文意義。這意味著即使在有限的資料情況下,模型也能夠產生更加流暢和自然的文本。

依據用戶的指示,LLMs可以執行各種從所未見的新任務,甚至不需要任何樣本、範例。

T5 (Text-to-Text Transfer Transformer) 模型

所有自然語言處理的任務,都可以化為序列對序列的生成任務

缺點包括:

  • 只能執行已經學過的任務
  • 對提示極其敏感,無法泛化
  • 缺乏推理能力,無法處理新任務
  • 即使在已知任務上,性能也可能有限
  • 有著輸入和輸出長度的限制。

LLM的演化歷史


大型語言模型具有以下特別能力:

  1. In-context learning(上下文學習): 這些模型能夠通過理解輸入文本的上下文來進行學習和產生輸出。它們能夠利用先前的信息和對話歷史來生成更加連貫和相關的回應。
  2. Instruction following(遵循指示): 大型語言模型能夠理解和遵循輸入中的指示或命令。它們能夠從自然語言描述中抽取出指示的含義,並執行相應的操作或生成符合指示的輸出。
  3. Step-by-step reasoning(逐步推理): 這些模型能夠通過逐步推理的方式來解決複雜的問題。它們能夠理解問題的各個步驟,從中推斷出答案或採取相應的行動,進而解決問題。

微調過程

微調過程如下:

  1. 從預訓練的 GPT 模型開始。
  2. 使用反向傳播算法訓練模型以最小化誤差。
  3. 使用上下文學習技術提高模型的性能。
  4. 使用元梯度 AWICL 算法進一步提高模型的性能。

此圖表顯示了微調過程的各個步驟

Dual View 是一種 上下文學習 技術,允許模型考慮輸入句子和查詢句子的上下文。它通過向模型提供兩個視圖來實現:

發佈日期:

Phi-2 vs Phi-3大語言模型初探

Phi-2 模型介紹

官方介紹: https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/

Phi-2 是一個擁有27 億個參數的 Transformer。它使用與Phi-1.5相同的資料來源進行訓練,並使用由各種 NLP 合成文字和過濾網站組成的新資料來源進行了增強(出於安全性和教育價值)。當根據測試常識、語言理解和邏輯推理的基準進行評估時,Phi-2 在參數少於 130 億的模型中展示了近乎最先進的性能。

Phi-3模型介紹

官方介紹: https://azure.microsoft.com/en-us/blog/introducing-phi-3-redefining-whats-possible-with-slms/

Phi-3-Mini-128K-Instruct 是一個擁有 38 億參數的輕量級最先進的開放模型,使用 Phi-3 資料集進行訓練。該數據集包括合成數據和經過過濾的公開網站數據,重點是高品質和推理密集屬性。

在初始訓練後,該模型經歷了訓練後過程,其中包括監督微調和直接偏好優化,以增強其遵循指令和遵守安全措施的能力。當根據測試常識、語言理解、數學、編碼、長期上下文和邏輯推理的基準進行評估時,Phi-3 Mini-128K-Instruct 在模型中展示了強大且最先進的性能130 億個參數。

指令實測

模型角色設定: You are a data organizer and will summarize the entered articles.

輸入文字:

Spotlight on Disability:IN Partners using technology to enhance the accessibility of products we use every day.
Amtrak
Amtrak Provides Accessibility Upgrades at Utah Stations

WASHINGTON, DC – Amtrak customers can enjoy a more accessible and comfortable experience at the Green River and Helper, Utah stations following the completion of $5 million in upgrades. Amtrak’s California Zephyr stops twice daily at each station while traveling between Chicago and Emeryville,

Apple
The Right Shortcuts Can Give Your iPhone Superpowers. Here’s How.| WashingtonPost.com

Take the pain out of tedious tasks with Apple’s Shortcuts app.

Aira
Free Aira Access Offers by State & Province | Aira.io

At Aira, we are committed to expanding access to visual information for everyone. In this spirit, we work with Access Partners all over who provide Aira for free to their students, customers, residents, and visitors. This means anyone who is at one of the below Access locations can open the Aira app on their smartphone and instantly be connected to a professional visual interpreter. If you’re interested in finding out where you can connect with a visual interpreter for free in your state of province, read on.

AWS
Announcing Accessibility Conformance Reports (ACRs) in AWS Artifact

Accessibility Conformance Reports (ACRs) for AWS products and services are now available on AWS Artifact, a self-service portal for AWS compliance-related information. ACRs are documents that demonstrate the accessibility of AWS services.

Through AWS Artifact, you can download ACRs on-demand to understand the accessibility of a specific AWS product or service. AWS ACRs utilize the ITI Voluntary Product Accessibility Templates (VPAT®) and reference various accessibility standards including Section 508 (U.S.), EN 301 549 (EU), and Web Content Accessibility Guidelines (WCAG).

Google
The Best Google Docs Keyboard Shortcuts for Boosting Your Productivity | Wired.com

Learn how to use keyboard shortcuts instead of mouse clicks for common tasks in Google Docs. You might be surprised at how much time you save.

Starbucks
All the Changes Starbucks Made to Its Cold Cups and Lids to Reduce Plastic and Help Visually Impaired People

The Starbucks tall, grande and venti cups will now all use the same lid.

輸出回應 – phi-2-GGUF

模型名稱: TheBloke/phi-2-GGUF/phi-2.Q2_K.gguf

模型首頁: https://huggingface.co/TheBloke/phi-2-GGUF

模型回應:

心得: 看不出關聯性…這根本不相關吧?

To remove a tree stump, cut down the tree first

How can you make sure the tree is cut off completely? Cut it with a chainsaw.

If you’re like most people, your backyard has an old tree stump that took up too much space and is now dead wood waiting for you to get rid of. Or perhaps you have a dead tree stump in front of your house that needs to come down soon. Either way, it’s time for the stump to go.

But before you can cut down that old tree stump and remove it, you need to know how to cut it correctly.

The first step is removing all branches from around the trunk. This will make your cutting easier.

Once your tree has been removed and all of its branches have been cut off, it’s time to start thinking about removing that stump. You can either rent a stump grinder or cut down the tree yourself. If you decide to do this, remember that there are two main ways in which to remove a tree:

  • Using a chainsaw
  • With an axe

The first method is easy to figure out and we’ll discuss it here. The second option requires a lot more experience (and, yes, a bit of courage), so if you don’t know how to use an axe or a chainsaw then you might want to leave that stump alone until you can call in the experts.

But first, what is a tree stump? Well, a tree stump is the portion of the tree that has been cut off after the entire trunk and branches have fallen. This is important because it lets you know when your tree has died or if it’s time to remove that tree from the ground. So how can you get this done?

Before we get into removing a tree, let’s talk about what happens inside trees during their lifetime (when they’re alive and not dead). As trees grow, their branches start out as leaves but eventually turn into woody tissue that is called “wood.” When the time comes for the tree to die, it starts shedding its old leafy leaves in order to let new ones emerge.

To cut down the entire tree, you have two options: cutting or grinding. Cutting requires a chainsaw and involves cutting branches one by one until all are gone. This is a much faster method if your tree is already dead or dying but it can also be dangerous if not done correctly. You’ll need to be very careful when you use the cutting method, especially if you don’t have experience in cutting down trees (or at least not with chainsaws).

Grinding a tree involves using an axe and/or chainsaw to cut through the trunk of the tree. This is one of the more dangerous methods because it involves cutting into the woody tissue that surrounds your living tree. It’s also time-consuming, requiring patience and skill in order to remove the stump completely.

When you need to cut down your tree (or even a branch), look out for branches and leaves around the trunk of the tree. If they aren’t there anymore, then it’s time to get cutting!

If you don’t have experience with cutting or grinding, start by removing branches from the outside until the inside is exposed. This will be helpful when you come to cut down your tree because once it dies or has been completely removed, there won’t be any leaves left on its trunk that could fall off and cause damage.

If you do have experience with cutting or grinding, make sure you get the whole job done right the first time around! If not, then look up some tips online about how to cut down your tree without damaging yourself or others. Remember, safety is key!

Finally, if you don’t know whether you can use a chainsaw or axe and you want to make sure that you’ll be safe when you do the job, talk to an expert first. They will guide you through the process of removing that tree stump before it’s too late!

輸出回應 – Phi-3-mini-4k-instruct-gguf

模型名稱: Phi-3-mini-4k-instruct-GGUF/Phi-3-mini-4k-instruct-Q8_0.gguf

模型首頁: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf

模型回應:

心得: 還不賴,phi-3試滿多次不同的輸入,成果真的還不錯,而且token長度可以到128k

Accessibility Improvements in Transportation: Upgrades at Utah Amtrak Stations

Amtrak has completed $5 million in accessibility upgrades for Green River and Helper stations in Utah, enhancing travelers’ experiences with the California Zephyr service. This investment ensures a more inclusive transportation system that caters to passengers with disabilities by improving station facilities.

Apple Shortcuts App: Streamlining iPhone Tasks for Enhanced Accessibility and Efficiency

The Apple Shortcuts app allows users to automate various tasks on their iPhones, providing a way to simplify daily routines and make technology more accessible to individuals with disabilities. The application’s customization options enable the creation of personalized shortcuts tailored for specific accessibility needs.

Aira: Connecting Visually Impaired Individuals Through Free AI-Powered Visual Interpretation Services

Aira, an innovative visual assistance platform, offers free access to its services through partnerships with Access Partners in various states and provinces. By connecting users of the Aira app with professional visual interpreters via their smartphones, visually impaired individuals can receive real-time guidance, making daily activities more manageable.

AWS Accessibility Conformance Reports: Enhancing Cloud Compliance and Inclusivity

Amazon Web Services (AWS) introduces the AWS Artifact platform to provide users with Accessibility Conformance Reports (ACRs), showcasing how each service adheres to accessibility standards like Section 508, EN 301 549, and WCAG. Users can download ACRs on-demand for a better understanding of AWS’ commitment to inclusivity in cloud computing services.

Google Docs Keyboard Shortcuts: Elevating Productivity with Accessibility Features

Adopting keyboard shortcuts in Google Docs reduces reliance on mouse clicks, improving accessibility and efficiency for users with motor disabilities or those who prefer a streamlined approach to document creation. Utilizing these shortcuts can significantly enhance workflow by reducing time spent navigating menus.

Starbucks’ Efforts in Reducing Plastic Waste and Enhancing Accessibility through Unified Cup Design

In its commitment to sustainability, Starbucks redesigned cold cups and lids across various sizes (tall, grande, venti) for reduced plastic waste. Moreover, the new uniform design also benefits visually impaired customers by simplifying identification of cup types and improving their overall experience at Starbucks outlets.

輸出回應 – phi-2-GGUF

模型名稱: TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf

模型首頁: https://huggingface.co/TheBloke/phi-2-GGUF

模型回應:

心得: 雖然沒有太好但至少和原文有相關

  1. Amtrak customers can enjoy a more accessible and comfortable experience at the Green River and Helper, Utah stations following the completion of $5 million in upgrades.
  2. Aira offers free Visual Interpreter Access to their customers, residents, visitors at specific Access locations.
  3. All Starbucks’ tall, grande and venti cups will now use the same lid.
  4. Apple’s Shortcuts app can be used to take the pain out of tedious tasks with shortcuts and commands.
  5. ACRs are documents that demonstrate the accessibility of AWS services.
  6. Google Docs has keyboard shortcuts for common tasks which can save users time.
  7. Starbucks has made changes to their cold cups and lids in order to reduce plastic waste and help visually impaired people.

輸出回應 – phi-2-GGUF

模型名稱: kroonen/phi-2-GGUF/phi-2_Q8_0.gguf

模型首頁: https://huggingface.co/TheBloke/phi-2-GGUF

模型回應:

心得: 只剩下最後一項星巴克的內容了…

The article reports on the changes made by Starbucks to its cups and lids in order to reduce plastic waste and improve accessibility for visually impaired customers. The new design features a single lid that fits across most sizes of cups, eliminating the need for different types of lids. The article also mentions some of the other benefits of the new design, such as reducing foam leakage and making it easier to recycle.

輸出回應 – dolphin-2_6-phi-2.Q8_0.gguf

模型名稱: TheBloke/dolphin-2_6-phi-2-GGUF/dolphin-2_6-phi-2.Q8_0.gguf

模型首頁: https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF

模型回應:

心得: 摘要能力算還不錯

Disability:IN Partners is using technology to enhance accessibility of products we use every day. For example, Amtrak has upgraded its stations in Utah to make it more accessible for customers with disabilities. Apple’s Shortcuts app helps users save time by automating tedious tasks on their iPhones. Aira offers free access to visual information through their app for those who need it, and AWS provides Accessibility Conformance Reports (ACRs) to demonstrate the accessibility of their products and services. Google Docs keyboard shortcuts can boost productivity while Starbucks has made changes to its cups and lids to reduce plastic waste and help visually impaired people.

發佈日期:

探索LM Studio:輕鬆測試和部署開源大型語言模型

在人工智能快速發展的今天,大型語言模型(LLM)已成為自然語言處理領域的重要工具。然而,對於許多開發者和AI愛好者來說,如何在本地環境中測試和部署這些強大的模型仍然是一個挑戰。這就是LM Studio發揮作用的地方,它為我們提供了一個便捷的平台,讓我們能夠輕鬆地探索各種開源LLM模型的潛力。

LM Studio:您的本地AI實驗室

LM Studio是一款專為測試和運行開源大型語言模型設計的應用程序。它的界面直觀易用,使得即使是AI領域的新手也能快速上手。通過LM Studio,您可以在自己的電腦上部署各種GPT模型,實現離線AI聊天機器人的功能,這不僅保護了隱私,還為AI應用的開發提供了更大的靈活性。

安裝LM Studio:開啟您的AI之旅

要開始使用LM Studio進行LLM模型的測試,首先需要完成安裝過程。以下是詳細的步驟:

  1. 訪問LM Studio官網:https://lmstudio.ai/
  2. 點擊”Download”按鈕,選擇適合您操作系統的版本。
  3. 下載完成後,按照提示完成安裝。

安裝過程簡單直接,很快您就能開始探索開源LLM模型的世界了。

成功安裝LM Studio後,您會發現它的界面設計非常直觀。主要功能區域包括:

  • 模型選擇區:這裡列出了您可以使用的各種開源LLM模型。
  • 聊天界面:您可以在這裡與選定的AI模型進行對話,測試其自然語言處理能力。
  • 參數設置區:調整模型的各項參數,優化AI的表現。
LM Studio的界面:功能一目了然

這樣的設計使得測試和比較不同的GPT模型變得輕而易舉,為您的AI實驗提供了理想的環境。

LM Studio介紹

LM Studio 是一款跨平台的桌面應用程式,可讓您輕鬆探索和使用本地和開源的大型語言模型 (LLM)。它提供了一個簡單但功能強大的模型配置和推理用戶界面,讓您可以輕鬆下載和運行任何與 ggml 兼容的模型來自 Hugging Face。

LM Studio 的主要功能包括:

  • 瀏覽和搜索來自 Hugging Face 的大量 ggml 兼容模型
  • 一鍵下載和安裝模型
  • 配置模型參數,例如溫度和頂級 P
  • 以多種格式生成文本、翻譯語言、編寫不同類型的創意內容以及以信息豐富的方式回答您的問題
  • 使用 GPU 加速推理(如果可用)

LM Studio 非常適合以下人群:

  • 對 LLM 感興趣的開發人員和研究人員
  • 想要嘗試使用 LLM 創建新應用程序的人
  • 需要使用 LLM 完成任務的任何人,例如編寫、翻譯或研究

使用 LM Studio 的優點:

  • 易於使用:LM Studio 具有簡單的用戶界面,即使是沒有 LLM 經驗的人也可以輕鬆使用。
  • 功能強大:LM Studio 提供了一系列功能,可讓您充分利用 LLM。
  • 可擴展:LM Studio 支持大量 ggml 兼容模型,並且不斷添加新模型。
  • 開源:LM Studio 是開源的,這意味著您可以自由使用和修改它。

開始使用 LM Studio

要開始使用 LM Studio,您需要先下載並安裝桌面應用程序。您可以從 LM Studio 網站: https://lmstudio.ai/ 下載應用程序。

安裝應用程序後,您需要創建一個 Hugging Face 帳戶。如果您已經有帳戶,則可以直接登錄。如果您沒有帳戶,則需要註冊新帳戶。

登錄後,您將能夠瀏覽和搜索來自 Hugging Face 的所有 ggml 兼容模型。找到您要使用的模型後,您可以單擊“下載”按鈕將其下載到您的計算機。

下載模型後,您可以單擊“運行”按鈕開始使用它。LM Studio 將打開一個新窗口,您可以在其中配置模型參數並生成文本。

有關 LM Studio 的更多信息,請參閱 用戶指南: https://lmstudio.ai/docs

下載模型的位置

下載的本地端模型預設會放在C:\Users\{USER_NAME}\.cache\lm-studio\models

若想要改變儲存的位置,可選擇左列的資料夾,然後選擇Change,就可以改變預設儲存的資料夾囉

應用程式截圖

總結

LM Studio 是一個功能強大且易於使用的工具,可讓您探索和使用本地和開源的 LLM。如果您有興趣了解 LLM 或想使用它們來創建新應用程序,那麼 LM Studio 是值得一試的工具。