国产精品电影_久久视频免费_欧美日韩国产激情_成年人视频免费在线播放_日本久久亚洲电影_久久都是精品_66av99_九色精品美女在线_蜜臀a∨国产成人精品_冲田杏梨av在线_欧美精品在线一区二区三区_麻豆mv在线看

OpenAI o1式思維鏈,開源模型也可以有,成功案例來了

人工智能 新聞
Llamaberry 能教會 AI 透徹地思考,就像是一位人類專家攻克難題時那樣。

北京時間 9 月 13 日午夜,OpenAI 發布了推理性能強大的 ο1 系列模型。之后,各路研究者一直在嘗試挖掘 ο1 卓越性能背后的技術并嘗試復現它。當然,OpenAI 也想了一些方法來抑制窺探,比如有多名用戶聲稱曾試圖誘導 ο1 模型公布其思維過程,然后收到了 OpenAI 的封號威脅。

圖片

盡管如此,不過三四天時間,就已經有研究者宣稱已經成功復現/開發出了與 ο1 性能差不多的推理技術,并且還不止一個!

Llamaberry:教會 AI 像聰明人一樣思考

Llamaberry 的提出者是 Martin Bowling。他開發的項目包括 RAGMiner.dev 和 Replit;其中前者可以幫助用戶毫不費力地將網站轉換成 Markdown、XML 或 JSON 等格式以便 RAG 和 LLM 應用使用,而后者則是一個使用 AI 將想法變成代碼的項目。

Llamaberry 的核心思路是使用思維鏈(CoT)來實現推理。這個名字自然源自代表 o1 模型的 Strawberry(草莓)。

HuggingFace地址:https://huggingface.co/spaces/martinbowling/Llamaberry

什么是思維鏈?Bowling 在博客中打了個比方:「思維鏈推理就像是給 AI 一個筆記本來展示其工作過程。其中不僅僅是簡單地給出答案,而是會帶領我們經歷其思維過程。」

Llamaberry 能教會 AI 透徹地思考,就像是一位人類專家攻克難題時那樣。

具體來說,Llamaberry 是一個多輪思維鏈推理系統的實現,其基于運行在 Groq 上的 Llama 3.1 70B 模型。

多輪推理是關鍵

多輪推理,顧名思義,就是讓模型在給出答案之前進行多步思考,而不是一步給出答案。打個比方,這就像是看一位大廚從備菜到完成擺盤一步步地完成一道精美菜肴,而不是直接微波加熱預制菜。

舉個示例:

第 1 輪:AI 先嘗試解決當前問題。

第 2 輪:AI 回顧第一次嘗試并盡力改進或優化其思維過程。

第 3 輪:再進行一輪反思和改進。

綜合結果:最后,將所有這些思考綜合到一起,得到一個連貫且合理的答案。

下面展示了這個多輪過程的示意圖:

圖片

可以看到,前一輪的輸出會成為后一輪的輸入,從而讓 AI 可在每個階段不斷完善其思維。最后,所有這些思考會凝練成一個合理的最終答案。就像看著一枚莓果逐漸成熟!

如何實現

下面將深入 Llamaberry 的實現細節。

1.設置舞臺

首先,我們需要為 AI 助手設置一些基本規則,代碼如下:

initial_system_prompt = """You are an AI assistant capable of detailed, step-by-step thinking. When presented with a question or problem, break down your thought process into clear, logical steps. For each step, explain your reasoning. Conclude with a final answer. Use the following markdown structure:

## Reasoning
1. [First step]
   **Explanation:** [Detailed explanation of this step]
2. [Second step]
   **Explanation:** [Detailed explanation of this step]
...

## Answer
[Final answer]

Be comprehensive and show your reasoning clearly."""

這就是提供給 AI 大廚的菜譜。它知道需要逐步分解其思考過程并解釋每個步驟,并且以 Markdown 格式將它們顯示出來。

2.思考過程

在每一輪推理中,都需要讓 AI 對問題進行思考。但在第一輪結束后,還需要求它思考之前已經思考過的東西。這就像問朋友,「嘿,還記得你之前說過什么嗎?讓我們再想一想。」

下面是每一輪的生成方式:

async def generate_turn(query: str, previous_turns: list = None) -> str:
    is_first_turn = previous_turns is None or len(previous_turns) == 0
if is_first_turn:
        messages = [{
            "role": "system",
            "content": initial_system_prompt
        }, {
            "role": "user",
            "content": query
        }]
    else:
        previous_content = "\n\n".join(previous_turns)
        messages = [{
            "role": "system",
            "content": followup_system_prompt
        }, {
            "role":
            "user",
            "content":
            f"Original Query: {query}\n\nPrevious Turns:\n{previous_content}\n\nProvide the next turn of reasoning."
        }]

    return await call_llm(messages)

該函數是多輪推理的核心。它決定我們是在第一輪還是在后續輪,并以此構建提示詞。對于后續輪,它會將之前所有推理輪都包含在上下文中,讓 AI 可以基于之前的思考進行構建。

3.綜合結果

經過三輪思考之后,再讓 AI 檢視其所有思考并得出一個合理的最終答案。這就像是讓專家討論問題,然后編寫最終報告。

async def synthesize_turns(query: str, turns: list) -> str:
    turns_text = "\n\n".join(
        [f"Turn {i+1}:\n{turn}" for i, turn in enumerate(turns)])
    messages = [{
        "role": "system",
        "content": synthesis_prompt
    }, {
        "role":
        "user",
        "content":
        f"Original Query: {query}\n\nTurns of Reasoning:\n{turns_text}"
    }]
    return await call_llm(messages)

這個綜合步驟至關重要,是 AI 綜合所有思考內容凝練出最終答案的一步。

單輪推理 vs 多輪推理

Martin Bowling 在其博客中簡單比較了單輪和多輪推理。

這里他采用了一個簡單示例,即詢問 AI:「人工智能對就業市場有什么潛在影響?」

單輪推理:

AI: Artificial intelligence will likely have significant impacts on the job market, including:
1. Automation of routine tasks
2. Creation of new job roles in AI development and maintenance
3. Potential job displacement in certain industries
4. Increased demand for skills in data analysis and machine learning

While AI may eliminate some jobs, it will also create new opportunities and increase productivity in many fields.

使用 Llamaberry 執行多輪推理:

第 1 輪:

AI: Let's approach this step-by-step:

1. Identify current AI capabilities
   Explanation: AI can perform data analysis, pattern recognition, and automate routine tasks.

2. Analyze vulnerable job sectors
   Explanation: Manufacturing, customer service, and data entry are likely to be affected.

3. Consider new job opportunities
   Explanation: AI development, data science, and AI ethics consultation may see growth.

4. Examine potential economic effects
   Explanation: Increased productivity might lead to economic growth, but wealth distribution could be a challenge.

Initial Answer: AI will likely cause significant shifts in the job market, with both job losses in some sectors and new opportunities in others.

第 2 輪:

AI: Let's refine our thinking:

1. Reassess the timeline of AI impact
   Explanation: The effects won't be immediate but will unfold over years or decades.

2. Consider the adaptability of the workforce
   Explanation: Retraining and education will be crucial for workers to transition to new roles.

3. Analyze potential societal changes
   Explanation: The nature of work itself might change, with more emphasis on creativity and emotional intelligence.

4. Examine global differences
   Explanation: AI's impact will vary across different countries and economies.

Refined Answer: AI's impact on the job market will be complex and gradual, requiring proactive measures in education and economic policy to ensure a smooth transition.

第 3 輪:

AI: Let's delve deeper:

1. Explore the concept of human-AI collaboration
   Explanation: Many jobs may evolve to involve working alongside AI rather than being replaced by it.

2. Consider the ethical implications
   Explanation: Issues like algorithmic bias in hiring processes need to be addressed.

3. Analyze the potential for new economic models
   Explanation: Universal Basic Income or reduced working hours might become more prominent discussions.

4. Examine historical parallels
   Explanation: Previous technological revolutions, like the Industrial Revolution, can offer insights into potential outcomes.

Further Refined Answer: While AI will undoubtedly transform the job market, its impact will likely be nuanced, involving collaboration between humans and AI, ethical considerations, and potentially new economic paradigms.

綜合答案:

AI: After careful consideration across multiple turns of reasoning, we can synthesize our thoughts on the potential impacts of artificial intelligence on the job market:

1. Job Transformation: AI will lead to significant changes in the job market, but these changes will be gradual and complex. While some jobs may be automated, many others will be transformed to involve collaboration between humans and AI. Industries like manufacturing, customer service, and data entry are likely to see the most immediate impacts.

2. New Opportunities: The rise of AI will create new job categories, particularly in fields like AI development, data science, AI ethics consultation, and human-AI interaction design. There will likely be an increased demand for skills in creativity, emotional intelligence, and complex problem-solving that AI cannot easily replicate.

3. Economic and Social Implications: The integration of AI into the workforce has the potential to increase productivity and economic growth. However, it also raises concerns about wealth distribution and may necessitate discussions about new economic models, such as Universal Basic Income or reduced working hours.

4. Education and Adaptation: The changing job market will require a strong emphasis on continuous learning and adaptation. Educational systems and workforce training programs will need to evolve to prepare people for the new reality of working alongside AI.

5. Ethical Considerations: As AI becomes more prevalent in hiring and work processes, addressing issues like algorithmic bias and ensuring fair opportunities for all workers will be crucial.

6. Global Variations: The impact of AI on the job market will not be uniform across the globe. Different countries and economies will experience varying effects based on their economic structures, technological readiness, and policy responses.

7. Historical Context: While AI represents a significant shift, it's important to view it in the context of previous technological revolutions. Like the Industrial Revolution, the AI revolution will likely lead to short-term disruptions but potentially long-term benefits if managed properly.

In conclusion, while AI will undoubtedly have profound impacts on the job market, these impacts will be multifaceted and evolve over time. The key to navigating this transition successfully lies in proactive measures in education, economic policy, and ethical governance, ensuring that the benefits of AI are broadly shared while mitigating potential negative effects.

可以看到,多輪方法能實現更加精細、全面的分析。這能從多個角度考慮問題,優化其思考,最后得到更加深思熟慮和全面詳細的答案。

Bowling 表示,這樣的多輪推理在思考深度、自我提升、透明度、靈活性等方面都有巨大優勢,同時其還采用了 Markdown 格式,使其結果更容易閱讀和用于后續流程。

因此,這種技術可讓 AI 進入更多實際應用場景,比如醫療診斷、法律分析、科學研究、商業策略、教育。當然,在使用 Llamaberry 等多輪推理系統時,也需要注意它們的局限和潛在的道德倫理問題,比如偏見、計算成本、過度依賴和隱私問題。

如何使用 Llamaberry?

Llamaberry 也很容易使用,點擊幾下就能擁有你自己的多輪推理系統。步驟如下:

  1. 前往 Replit,點擊該鏈接獲取 Llamaberry 模板:https://replit.com/@MartinBowling/Llamaberry-Powered-By-Groq?v=1
  2. 創建模板分支:點擊 Fork 按鈕創建你自己的 Llamaberry 項目副本。
  3. 獲取你的 Groq API Key:注冊 Groq 賬戶,獲取 API Key。
  4. 設置環境:在你的分支 Replit 項目中,找到「Secrets」選項卡。添加一個新密鑰,密鑰為 GROQ_API_KEY,值是你的 Groq API 密鑰。
  5. 運行項目:單擊 Replit 界面頂部的 Run 按鈕。這將啟動 Llamaberry 應用。
  6. 開始實驗:應用運行起來后,你將看到一個 Gradio 界面。你可以在其中輸入問題并查看 Llamaberry 多輪推理的實際效果!并且輸出是簡潔漂亮的 Markdown 格式!

了解了 Llamaberry,下面來看另一個號稱實現了類 o1 推理鏈的項目:g1。

g1:實現類似 ο1 的推理鏈

g1 這個項目來自 Benjamin Klieger,他是 Groq 的一位研究者。也因此,g1 同樣基于 Groq,并且其也使用了 Llama 3.1 70b 模型。

不同于 Llamaberry 使用的多輪思維鏈推理,g1 的策略是角色扮演、思維鏈提示 、格式化以及另一些提示技巧。并且,g1 開源了。

項目地址:https://github.com/bklieger-groq/g1


圖片

開發者宣稱 g1 有 70% 的時間能成功數出 Strawberry 中有多少個 R,同時無需任何微調或少樣本技術。下面是其一次執行過程: 

圖片

開發者 Klieger 表示,g1 和 ο1 一樣能讓 LLM 有能力「思考」和解決之前的領先模型難以應對的邏輯問題。但不同之處在于,g1 會大方地展示所有推理 token。同時,他也強調了 g1 和 ο1 在技術上的差異,其中后者使用了大規模強化學習來執行思維鏈推理。而 g1 則是通過發掘提示詞工程的潛力來幫助 LLM 解決簡單的邏輯問題,讓現有的開源模型也能受益于動態推理鏈和優化般的探索界面。

g1 的工作方式

由 Llama 3.1 70b 支持的 g1 會創建一種動態的思維鏈。

在每個步驟中,LLM 可以選擇是繼續進行另一個推理步驟,還是提供最終答案。每個步驟都有標題,并且對用戶可見。

系統提示詞中還會包含給 LLM 的提示。其提示策略如下:

You are an expert AI assistant that explains your reasoning step by step. For each step, provide a title that describes what you're doing in that step, along with the content. Decide if you need another step or if you're ready to give the final answer. Respond in JSON format with 'title', 'content', and 'next_action' (either 'continue' or 'final_answer') keys. USE AS MANY REASONING STEPS AS POSSIBLE. AT LEAST 3. BE AWARE OF YOUR LIMITATIONS AS AN LLM AND WHAT YOU CAN AND CANNOT DO. IN YOUR REASONING, INCLUDE EXPLORATION OF ALTERNATIVE ANSWERS. CONSIDER YOU MAY BE WRONG, AND IF YOU ARE WRONG IN YOUR REASONING, WHERE IT WOULD BE. FULLY TEST ALL OTHER POSSIBILITIES. YOU CAN BE WRONG. WHEN YOU SAY YOU ARE RE-EXAMINING, ACTUALLY RE-EXAMINE, AND USE ANOTHER APPROACH TO DO SO. DO NOT JUST SAY YOU ARE RE-EXAMINING. USE AT LEAST 3 METHODS TO DERIVE THE ANSWER. USE BEST PRACTICES.

Example of a valid JSON response:
json
{
    "title": "Identifying Key Information",
    "content": "To begin solving this problem, we need to carefully examine the given information and identify the crucial elements that will guide our solution process. This involves...",
    "next_action": "continue"
}

對這些提示詞的詳細解釋請參閱原項目的 Prompt Breakdown 一節。這里就不贅述了,僅給出幾個示例,比如可以在提示詞中加入「include exploration of alternative answers」(探索其它答案)和「use at least 3 methods to derive the answer」(使用至少三種方法來得出答案)。

這樣一來,通過組合思維鏈以及嘗試多種方法、探索其它答案、質疑之前草擬的解答、考慮 LLM 的局限性等策略,就能顯著提升 LLM 的推理能力。

在數 Strawberry 中有多少個 R 這個經典問題上,無需任何訓練,g1 就能幫助 Llama 3.1 70b 達到約 70% 的準確度(n=10, How many Rs are in strawberry?)。而如果不使用提示技術,Llama 3.1 70b 的準確率為 0%,ChatGPT-4o 的也只有 30%。

下面展示了另一個示例:0.9 和 0.11 哪個更大?

圖片

詳細的安裝過程和代碼請參閱原項目。

最后,順便一提,另有開發者發布了 g1 的分支版 Mult1,該版本的一大改進是可使用多個 AI 提供商來創建類似 o1 的推理鏈,感興趣的讀者可訪問:https://github.com/tcsenpai/multi1

責任編輯:張燕妮 來源: 機器之心
相關推薦

2024-09-24 11:01:03

2024-09-14 12:51:04

2025-02-03 14:17:27

2024-10-05 00:00:00

2024-12-05 10:16:14

2025-02-19 13:50:00

明星編程軟件

2024-09-13 10:06:21

2024-12-09 11:06:31

2025-02-08 17:00:11

2025-01-23 14:53:15

2024-11-07 15:40:00

2025-01-08 13:08:55

2024-09-13 09:26:17

2025-01-21 09:00:00

2024-12-26 16:44:27

2024-11-25 08:30:00

2024-11-25 17:23:10

2025-04-29 09:06:00

2025-07-16 12:51:24

點贊
收藏

51CTO技術棧公眾號

国产精品手机在线| 999在线观看免费大全电视剧| 快播av资源| 欧美成人一品| 国产一区二区三区久久精品| 在线一二三区| 久久奇米777| 日韩av不卡在线播放| 天海翼精品一区二区三区| 亚洲精品一区在线观看| 中文官网资源新版中文第二页在线观看| 国产精品一二三在| 国产精品国模大尺度私拍| 日韩一区二区三区精品视频第3页| 999色成人| 国产av不卡一区二区| 日韩不卡一区| 欧美日韩福利视频| 成人性生交大片免费观看网站| 在线视频一区二区三| 嘿咻视频在线看| 日本一区二区三区视频视频| 中文字幕综合在线观看| 激情成人亚洲| 91传媒免费看| 久久高清精品| 91极品女神在线| aa亚洲一区一区三区| 亚洲欧美综合另类中字| a毛片在线看免费观看| 91国模大尺度私拍在线视频| 最新在线地址| 亚洲午夜免费视频| 九色免费视频| 一区二区理论电影在线观看| 成人免费xx| 国产精品久久久久7777按摩| 免费男同深夜夜行网站| 国产亚洲欧美日韩在线一区| 国产xxxxx在线观看| 99久久免费视频.com| 黄页网站大全在线观看| 国产成人av一区二区| a天堂资源在线观看| 国产成人午夜高潮毛片| 免费看国产曰批40分钟| 粉嫩av一区二区三区| 国产美女主播在线| 久久综合久色欧美综合狠狠| 男人添女人下面高潮视频| 99久久综合精品| 成年人在线观看视频免费| 国产午夜精品理论片a级大结局| 免费在线a视频| 国产清纯在线一区二区www| 自拍偷拍一区二区三区四区| 亚洲视频狠狠干| 在线一区二区三区精品| 色琪琪一区二区三区亚洲区| 尤物在线视频| 亚洲第一二三四五区| 日本在线视频一区二区| 欧美成人在线免费视频| 国产成人精品免费视| 91在线国产电影| 久久aⅴ国产紧身牛仔裤| 男女啪啪免费观看| 欧美高清在线一区| 深夜福利在线看| 亚洲午夜精品久久久久久久久| 精品福利视频导航大全| 欧美变态口味重另类| 激情久久一区二区| 欧美洲成人男女午夜视频| 亚洲激情av| 亚洲色成人www永久在线观看 | 国产精品亚发布| 国内精品99| 日本精品福利视频| 中文在线一区二区| 国产在线三区| 国产小视频91| 精品国产乱码久久久久久蜜坠欲下| 91九色在线免费视频| 国产精品456| 美女视频免费观看网站在线| 7777女厕盗摄久久久| 成人精品一区二区三区电影| 国产精品国产三级国产aⅴ浪潮| 亚洲另类自拍| 不卡av免费在线| 欧美日韩国产精品自在自线| 久久久加勒比| 国产精品xxx在线观看www| 懂色av一区二区夜夜嗨| 中文字幕在线二区| 亚洲欧洲午夜一线一品| 日本a口亚洲| 亚洲国产精品无码观看久久| 性做久久久久久免费观看| 欧美在线极品| 成人看片人aa| 国产亚洲欧美色| 日韩三级免费| 国产精品对白刺激| 不卡区在线中文字幕| 日本视频在线播放| 亲子乱一区二区三区电影| 美女精品自拍一二三四| 95影院理论片在线观看| 国产一区二区三区在线播放免费观看| 99久久99热这里只有精品| 尤物国产精品| 亚洲欧美成人网| 成人交换视频| 国产精品日韩在线播放| 久久久999| 女同性恋一区二区| 精品一区二区三区免费观看| 国产偷人视频免费| 欧美午夜精品一区二区蜜桃| 日韩精品中文字幕吗一区二区| 色偷偷综合社区| 肉色丝袜一区二区| 五十路熟女丰满大屁股| 国产成人综合精品三级| 精品久久久国产精品999| 蜜桃视频动漫在线播放| 国产日韩中文字幕| av中文字幕一区| 欧美一区在线直播| 久久国产精品高清一区二区三区| 久久精品成人一区二区三区| 国产视频一区欧美| 全部a∨一极品视觉盛宴| 亚洲一级黄色片| 日一区二区三区| yiren22亚洲综合伊人22| 国产成人在线视频| 中文字幕第一区综合| 亚洲成人一区在线观看| 亚洲国产精品www| 欧美高清视频不卡网| 色135综合网| 老司机aⅴ毛片免费观看| 深夜福利91大全| 久久99精品一区二区三区三区| 欧美18一19xxx性| 在线日韩精品视频| 欧美嫩在线观看| 久久免费黄色| 77777影视视频在线观看| 日韩视频123| 成人精品国产福利| 成人在线视频你懂的| 国产精品igao激情视频| 国产一区二区日韩| 青青草91久久久久久久久| 男女午夜视频在线观看| 国产精品一区二区三区成人| 在线免费不卡电影| 亚洲乱码电影| 天堂av资源在线观看| 国产精品xxx视频| 亚洲综合久久久久| 亚洲少妇在线| 久久女人天堂| 日本视频一二三区中文字幕| 亚洲黄色免费网站| 日韩欧美一级在线播放| 欧美日韩卡一| 日韩网站在线免费观看| 日韩毛片在线看| 精品一区二区三区在线播放| 国内激情视频在线观看| 成年人黄色在线观看| 亚洲精品中文字幕av| 国产成人自拍网| 久久99精品久久久野外观看| 国产成人黄色网址| 国产日韩精品电影| 欧美年轻男男videosbes| 精品一区二区在线免费观看| 本网站久久精品| 在线视频日韩一区| 国产精品爽黄69天堂a| 色又黄又爽网站www久久| 99热这里只有成人精品国产| 爱情岛亚洲播放路线| 无码毛片aaa在线| 久久久久久久久久久久av| 一区二区在线电影| 欧美日韩国产欧| 国产精品久久网| 欧美黄色片在线观看| 51精品国产人成在线观看| 成人性教育视频在线观看| 男人午夜天堂| 久久精品色图| 国产精品伦理|