[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72182":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},72182,"g1","build-with-groq\u002Fg1","build-with-groq","g1: Using Llama-3.1 70b on Groq to create o1-like reasoning chains","",null,"Python",4178,359,52,1,0,29.67,"MIT License",false,"main",[22],"managed-by-terraform","2026-06-12 02:02:59","# g1: Using Llama-3.1 70b on Groq to create o1-like reasoning chains\n\n[Video Demo](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fdb2a221f-f8eb-48c3-b5a7-8399c6300243)\n\nThis is an early prototype of using prompting strategies to improve the LLM's reasoning capabilities through o1-like reasoning chains. This allows the LLM to \"think\" and solve logical problems that usually otherwise stump leading models. Unlike o1, all the reasoning tokens are shown, and the app uses an open source model.\n\ng1 is experimental and being open sourced to help inspire the open source community to develop new strategies to produce o1-like reasoning. This experiment helps show the power of prompting reasoning in visualized steps, not a comparison to or full replication of o1, which uses different techniques. OpenAI's o1 is instead trained with large-scale reinforcement learning to reason using Chain of Thought, achieving state-of-the-art performance on complex PhD-level problems. \n\ng1 demonstrates the potential of prompting alone to overcome straightforward LLM logic issues like the Strawberry problem, allowing existing open source models to benefit from dynamic reasoning chains and an improved interface for exploring them.\n\n\n### How it works\n\ng1 powered by Llama3.1-70b creates reasoning chains, in principle a dynamic Chain of Thought, that allows the LLM to \"think\" and solve some logical problems that usually otherwise stump leading models.\n\nAt each step, the LLM can choose to continue to another reasoning step, or provide a final answer. Each step is titled and visible to the user. The system prompt also includes tips for the LLM. There is a full explanation under Prompt Breakdown, but a few examples are asking the model to “include exploration of alternative answers” and “use at least 3 methods to derive the answer”.\n\nThe reasoning ability of the LLM is therefore improved through combining Chain-of-Thought with the requirement to try multiple methods, explore alternative answers, question previous draft solutions, and consider the LLM’s limitations. This alone, without any training, is sufficient to achieve ~70% accuracy on the Strawberry problem (n=10, \"How many Rs are in strawberry?\"). Without prompting, Llama-3.1-70b had 0% accuracy and ChatGPT-4o had 30% accuracy.\n\n\n### Examples\n\n> [!IMPORTANT]\n> g1 is not perfect, but it can perform significantly better than LLMs out-of-the-box. From initial testing, g1 accurately solves simple logic problems 60-80% of the time that usually stump LLMs. However, accuracy has yet to be formally evaluated. See examples below.\n\n\n##### How many Rs are in strawberry?\n\nPrompt: How many Rs are in strawberry?\n\nResult:\n\n![Strawberry example](examples\u002Fstrawberry.png)\n\n---\n\nPrompt: Which is larger, .9 or .11?\n\nResult:\n\n![0.9 or 0.11 example](examples\u002Fmath.png)\n\n\n### Quickstart\n\nTo use the Streamlit UI, follow these instructions:\n\n~~~\npython3 -m venv venv\n~~~\n\n~~~\nsource venv\u002Fbin\u002Factivate\n~~~\n\n~~~\npip3 install -r requirements.txt\n~~~\n\n~~~\nexport GROQ_API_KEY=gsk...\n~~~\n\n~~~\nstreamlit run app.py\n~~~\n\n---\n\nAlternatively, follow these additional instructions to use the Gradio UI:\n\n~~~\ncd gradio\n~~~\n\n~~~\npip3 install -r requirements.txt\n~~~\n\n~~~\npython3 app.py\n~~~\n\n\n### Prompting Strategy\n\nThe prompt is as follows:\n\n```\nYou 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.\n\nExample of a valid JSON response:\njson\n{\n    \"title\": \"Identifying Key Information\",\n    \"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...\",\n    \"next_action\": \"continue\"\n}\n```\n\n#### Breakdown\n\nFirst, a persona is added:\n\n> You are an expert AI assistant that explains your reasoning step by step.\n\n\n\nThen, instructions to describe the expected step-by-step reasoning process while titling each reasoning step. This includes the ability for the LLM to decide if another reasoning step is needed or if the final answer can be provided.\n\n> 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. \n\n\n\nJSON formatting is introduced with an example provided later.\n\n> Respond in JSON format with 'title', 'content', and 'next_action' (either 'continue' or 'final_answer') keys. \n\n\n\nIn all-caps to improve prompt compliance by emphasizing the importance of the instruction, a set of tips and best practices are included.\n\n1. Use as many reasoning steps as possible. At least 3. -> This ensures the LLM actually takes the time to think first, and results usually in about 5-10 steps.\n2. Be aware of your limitations as an llm and what you can and cannot do. -> This helps the LLM remember to use techniques which produce better results, like breaking \"strawberry\" down into individual letters before counting.\n3. Include exploration of alternative answers. Consider you may be wrong, and if you are wrong in your reasoning, where it would be. -> A large part of the gains seem to come from the LLM re-evaluating its initial response to ensure it logically aligns with the problem.\n4. 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. -> This encourages the prevention of the LLM just saying it re-examined a problem without actually trying a new approach. \n5. Use at least 3 methods to derive the answer. -> This helps the LLM come to the right answer by trying multiple methods to derive it.\n6. Use best practices. -> This is as simple as the \"Do better\" prompts which improve LLM code output. By telling the LLM to use best practices, or do better, it generally performs better!\n\n\n> 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.\n\n\n\nFinally, after the problem is added as a user message, an assistant message is loaded to provide a standardized starting point for the LLM's generation.\n\n> Assistant: Thank you! I will now think step by step following my instructions, starting at the beginning after decomposing the problem\n\n\n### Top Forks\n\n* Huggingface Spaces Demo: [![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fxylin\u002Fg1-demo)\n* Mult1: Using multiple AI providers to create o1-like reasoning chains ([GitHub Repository](https:\u002F\u002Fgithub.com\u002Ftcsenpai\u002Fmulti1))\n* thinkR: o1 like chain of thoughts with local LLMs in R ([GitHub Repository](https:\u002F\u002Fgithub.com\u002Feonurk\u002FthinkR))\n\n### Credits\n\nThis app was developed by Benjamin Klieger.\n","g1项目通过在Groq上使用Llama-3.1 70b模型来创建类似o1的推理链，以提升语言模型的逻辑推理能力。该项目的核心功能在于采用特定的提示策略，使模型能够逐步思考并解决通常会让其他先进模型困惑的逻辑问题，如“草莓问题”。技术特点包括动态思维链的应用以及对多种方法和替代答案探索的要求，这显著提高了模型处理逻辑问题的能力。g1适用于需要增强开源语言模型推理性能的研究场景或应用开发中，尤其适合那些希望通过改进提示技术而非重新训练模型来提高解决问题效率的情况。",2,"2026-06-11 03:40:43","high_star"]