Hướng dẫn này trình bày một số phương pháp sử dụng mô hình Tư duy Gemini. Các mô hình này cho phép nhà phát triển giải quyết các vấn đề phức tạp bằng cách chia nhỏ các vấn đề đó thành các bước nhỏ hơn, dễ quản lý hơn. Phương pháp từng bước này không chỉ nâng cao hiệu suất cho các nhiệm vụ khó khăn mà còn cung cấp thông tin chi tiết có giá trị về quy trình suy luận của Gemini cho nhà phát triển, hiển thị trong giao diện người dùng Google AI Studio. Hiện tại, các mô hình có khả năng tư duy bao gồm Gemini 2.0 Flash Thinking và Gemini 2.5 Pro Experimental with thinking (thử nghiệm).
Kỹ thuật nhắc
Việc đưa ra câu lệnh hiệu quả là yếu tố quan trọng để tối đa hoá lợi ích của các mô hình tư duy của Gemini. Sau đây là một số kỹ thuật bạn nên cân nhắc:
Bắt đầu
Bắt đầu bằng hướng dẫn chung mô tả kết quả mong muốn. Bắt đầu bằng một câu lệnh đơn giản và quan sát suy nghĩ ban đầu của mô hình về cách giải quyết thử thách.
Describe the most unusual or striking architectural feature you've ever seen in a building or structure. <...> The most unusual architectural feature that has truly stayed with me is the "floating roof" of the Heydar Aliyev Center in Baku, Azerbaijan, designed by Zaha Hadid Architects. Visually, it's breathtaking. Imagine a vast, undulating landscape of pure white, seemingly draped over the building. It's not just a roof in the traditional sense; it's an extension of the ground, flowing seamlessly upwards and over the building's various spaces before curving back down to meet the earth again. There are no sharp angles, no rigid lines. Instead, everything is fluid, organic, and continuous. It resembles a giant, pristine white wave frozen in motion, or perhaps a sand dune sculpted by an unseen wind. <...> |
Cung cấp hướng dẫn từng bước
Nếu lần thử đầu tiên không mang lại kết quả mong muốn, hãy tinh chỉnh câu lệnh bằng cách cung cấp hướng dẫn từng bước rõ ràng hơn để hướng dẫn Gemini giải quyết vấn đề theo cách tập trung hơn. Điều này cho phép bạn định hướng cách hiểu ban đầu của mô hình về nhiệm vụ bằng các đề xuất và hướng dẫn rõ ràng.
Now imagine that architectural feature is not just for looks, but has a specific function or purpose related to the building's environment or the people who use it. Explain what that function could be and how it enhances the building's overall design and usability. <...> Let's imagine that the "floating roof" of the Heydar Aliyev Center is not purely aesthetic but serves a crucial environmental and user-centric function: it's designed as a sophisticated climate moderator and natural ventilation system for the Baku environment. Here's how this function would work and enhance the building: Function: Passive Climate Control and Natural Ventilation System Shading and Solar Heat Mitigation: The undulating curves of the white GFRC roof are strategically shaped and oriented to provide optimal shading throughout the day, year-round. Baku experiences intense sun, especially during the summer. The overhanging curves, acting like giant brise-soleils, would block direct sunlight from hitting the building's glass facade, significantly reducing solar heat gain. The varying heights and depths of the curves would create dynamic shade patterns, ensuring that different parts of the building are shaded at different times of the day, optimizing comfort and reducing the need for excessive air conditioning. The white color of the GFRC further enhances this by reflecting a large portion of the solar radiation. <...> |
Lời nhắc chụp nhiều lần bằng tính năng Tư duy
Tính năng nhắc chụp nhiều lần kết hợp với tính năng suy nghĩ có thể giúp Gemini hiểu rõ hơn và cải thiện độ chính xác của câu trả lời. Cung cấp một số ví dụ về cặp đầu vào-đầu ra, minh hoạ hành vi và định dạng đầu ra mong muốn trong câu lệnh của bạn.
Example 1: User: What is the tallest mountain in the world? Assistant: Mount Everest Example 2: User: What is the largest ocean? Assistant: Pacific Ocean User: What is the longest river in the world? Assistant: Amazon River |
Xác định đầu ra và hành vi
Khi xây dựng một ứng dụng mà người dùng sẽ tương tác trực tiếp với mô hình, bạn nên cung cấp hướng dẫn về cách định dạng và phát âm đầu ra cũng như câu trả lời của Gemini.
Hướng dẫn về hệ thống
Hướng dẫn hệ thống là một tập hợp hướng dẫn mà mô hình xử lý trước khi xử lý lời nhắc. Các hàm này được gọi lại mỗi khi mô hình được nhắc và cho mô hình biết cách bạn muốn mô hình hoạt động và phản hồi. Ví dụ: bạn có thể thêm các thông tin như vai trò hoặc tính cách, thông tin theo ngữ cảnh và hướng dẫn định dạng.
System Instruction: You are a helpful and concise coding tutor. Always provide code examples and explain them briefly. User Prompt: Explain what is a closure in Javascript and give an example. function outerFunction(outerVar) { function innerFunction(innerVar) { console.log(outerVar); // Accessing outerVar from outerFunction's scope console.log(innerVar); } return innerFunction; } const closureExample = outerFunction('I am from outer'); closureExample('I am from inner'); Explanation: A closure is created when a function (innerFunction in this example) is defined inside another function (outerFunction) and the inner function remembers and has access to the variables from the outer function's scope, even after the outer function has finished executing. In the example: outerFunction is called with 'I am from outer' and returns innerFunction. closureExample now holds a reference to innerFunction. When closureExample('I am from inner') is called, innerFunction executes. Even though outerFunction has already finished, innerFunction can still access and use outerVar (which is 'I am from outer') because of the closure. In essence, the innerFunction "closes over" the variables of its outer function's scope, creating a closure. |
Xác minh và phản ánh
Thêm trực tiếp các bước xác minh cụ thể vào Hướng dẫn của hệ thống hoặc lời nhắc của bạn. Ví dụ: yêu cầu Gemini xác minh nguồn, xem xét lý do, xác định lỗi tiềm ẩn và kiểm tra câu trả lời cuối cùng.
Verify the following statement and provide your sources: The capital of Brazil is Rio de Janeiro. The statement "The capital of Brazil is Rio de Janeiro" is incorrect. The current capital of Brazil is Brasília. Rio de Janeiro was the capital of Brazil for a significant period, from 1763 to 1960. However, the capital was moved to Brasília in 1960 as part of a plan to develop the country's interior and create a more centrally located capital. Verification and Sources: You can easily verify this information from numerous reliable sources: Encyclopedias: Britannica: Searching for "Brazil" on Britannica will clearly state Brasília as the capital. https://www.britannica.com/place/Brazil (Look for the "Capital" information in the introductory summary or "Geography" section) Wikipedia: The Wikipedia article for "Brazil" also states Brasília as the capital. https://en.wikipedia.org/wiki/Brazil (Look in the infobox or introductory section) Government and Official Sources: CIA World Factbook: This is a highly reliable source for country information. Searching for "Brazil" will list Brasília as the capital. https://www.cia.gov/the-world-factbook/countries/brazil/ (Look under "Government" > "Capital") Official Website of the Brazilian Government (if accessible and in English): While navigating official government websites can sometimes be complex, they would definitively list Brasília as the capital. Geographic Resources: National Geographic: Their website and publications will confirm Brasília as the capital of Brazil. Atlases and Geography Textbooks: Any modern atlas or geography textbook will list Brasília as the capital. Why the confusion? The confusion might arise because: Rio de Janeiro is a very famous Brazilian city: It's a major tourist destination, known for its beaches, Carnival, and iconic landmarks like Christ the Redeemer. Its past status as capital adds to its historical significance and public recognition. Historical context: Rio de Janeiro was the capital for a long time. People who learned about Brazil in the past might remember it as the capital. In conclusion, the statement is false. The capital of Brazil is Brasília, not Rio de Janeiro. Rio de Janeiro was the former capital but is no longer the current capital. You can confidently use the sources listed above to verify this information. |
Tận dụng công cụ bằng tư duy
Các mô hình Tư duy của Gemini có thể tận dụng các công cụ để thực hiện các hành động ngoài việc tạo văn bản. Điều này cho phép chúng tương tác với các hệ thống bên ngoài, thực thi mã hoặc truy cập thông tin theo thời gian thực, kết hợp kết quả vào quá trình suy luận và phản hồi cuối cùng. Bạn có thể bật các công cụ thông qua cấu hình API.
Công cụ tìm kiếm
Công cụ tìm kiếm cho phép mô hình truy vấn các công cụ tìm kiếm bên ngoài để tìm thông tin mới nhất hoặc thông tin ngoài dữ liệu huấn luyện. Cách này hữu ích cho những câu hỏi về các sự kiện gần đây hoặc chủ đề rất cụ thể.
What were the major scientific breakthroughs announced last week? Based on recent search results, here are some highlights from the past week in science: * **[Specific Breakthrough 1]:** [Brief description based on search results, e.g., A new study published in Nature details advancements in battery technology...] * **[Specific Breakthrough 2]:** [Brief description based on search results, e.g., Researchers at MIT announced progress in understanding dark matter...] * **[Specific Breakthrough 3]:** [Brief description based on search results, e.g., The James Webb Space Telescope captured new images revealing...] (Note: The model would use the search tool to find relevant news and articles from the specified timeframe and synthesize the information. Grounding metadata citing the sources would also typically be available via the API.) |
Công cụ thực thi mã
Công cụ thực thi mã cho phép mô hình viết và chạy mã (ví dụ: Python) để thực hiện các phép tính, thao tác với dữ liệu hoặc giải quyết các vấn đề được xử lý tốt nhất theo thuật toán. Mô hình nhận được kết quả của mã và có thể sử dụng kết quả đó trong phản hồi.
What is the sum of the first 50 prime numbers? Generate and run Python code for the calculation, and make sure you get all 50. Provide the final sum clearly. Okay, I can calculate that. I will generate Python code to find the first 50 prime numbers and sum them up. ```python def is_prime(num): if num < 2: return False for i in range(2, int(num**0.5) + 1): if num % i == 0: return False return True primes = [] num = 2 while len(primes) < 50: if is_prime(num): primes.append(num) num += 1 total_sum = sum(primes) print(total_sum) ``` Running the code... Code Execution Result: Outcome: OK Output: 5117 Use code with caution. The sum of the first 50 prime numbers is 5117. |
Kết quả có cấu trúc
Bạn có thể hướng dẫn mô hình định dạng đầu ra theo một cấu trúc cụ thể, chẳng hạn như JSON. Điều này đặc biệt hữu ích khi tích hợp đầu ra của mô hình vào các ứng dụng. Bạn có thể chỉ định định dạng và giản đồ mong muốn ngay trong lời nhắc hoặc sử dụng các tham số API như "response_mime_type" để kiểm soát hiệu quả hơn khi có.
Provide a list of 3 famous physicists and their key contributions in JSON format. Use this JSON schema: Physicist = {'name': str, 'contribution': str, 'era': str} Return: list[Physicist] ```json [ { "name": "Albert Einstein", "contribution": "Theory of Relativity (Special and General)", "era": "Early 20th Century" }, { "name": "Isaac Newton", "contribution": "Laws of Motion and Universal Gravitation", "era": "Late 17th / Early 18th Century" }, { "name": "Marie Curie", "contribution": "Pioneering research on radioactivity", "era": "Late 19th / Early 20th Century" } ] ``` |
Gỡ lỗi và điều hướng
AI Studio của Google cung cấp cho nhà phát triển quyền truy cập vào suy nghĩ của mô hình trong giao diện người dùng. Điều này sẽ hữu ích khi nhà phát triển xem xét lời nhắc của bạn khi gỡ lỗi:
Phân tích quy trình tư duy
Hãy xem xét kỹ quy trình suy nghĩ của Gemini để xác định mọi khía cạnh có thể đã sai lệch. Phân tích này có thể cung cấp các gợi ý có giá trị để tinh chỉnh câu lệnh và nhận được phản hồi dự kiến một cách nhất quán trong ứng dụng.
Tình huống mẫu: Nếu quy trình suy nghĩ của Gemini cho thấy nó đã hiểu sai một bước trong một hướng dẫn phức tạp, bạn có thể tinh chỉnh câu lệnh để làm rõ bước cụ thể đó.
Step 1: Summarize the following article about quantum physics. Step 2: Translate the summary into Spanish. Step 3: Extract the key entities from the Spanish summary. Article: ... [Article Text] ... The user wants me to process an article about Google's new quantum chip called Willow in three steps: Step 1: Summarize the article. Step 2: Translate the summary into Spanish. Step 3: Extract the key entities from the Spanish summary. Let's break down each step. Step 1: Summarize the article. I need to read the article and identify the main points. The article is about Google's new quantum chip, Willow, and its achievements. The key achievements are: Exponential error reduction as qubits scale up. Outperforming supercomputers in a benchmark computation (RCS). Willow is a step towards commercially relevant quantum computing. It's the first system below threshold for quantum error correction. It achieved a benchmark computation in under 5 minutes that would take a supercomputer 10 septillion years. It was fabricated in a new facility. It has state-of-the-art performance and high quality qubits. Google is looking towards real-world applications with Willow. Quantum computing will benefit AI. I will synthesize these points into a concise summary. Step 2: Translate the summary into Spanish. Once I have the summary in English, I will translate it into Spanish. I need to ensure the translation is accurate and natural-sounding in Spanish. Step 3: Extract the key entities from the Spanish summary. After translating the summary, I will identify and extract the key entities. Key entities are typically nouns or noun phrases that represent important objects, concepts, or actors. In this context, they will likely include: Names of chips (Willow, Sycamore) Companies/Organizations (Google Quantum AI, Google Research) Technologies (quantum chip, quantum computer, qubits, quantum error correction, superconducting quantum system, classical computers, supercomputers, AI) Benchmarks (random circuit sampling, RCS) People (Julian Kelly, Peter Shor, David Deutsch, Sergio Boixo, Hartmut Neven, John Preskill) Concepts (exponential error reduction, below threshold, beyond breakeven, state-of-the-art performance, commercially relevant applications, quantum mechanics, multiverse, T1 times, system benchmarks, algorithmic benchmarks) I will need to carefully review the Spanish summary to identify these entities and list them out. |
Provide Corrective Feedback
If you observe errors or inconsistencies in Gemini's reasoning, provide corrective feedback in your prompt and/or System Instructions to anticipate where the model's response may deviate from your desired outcome.
You are an expert in botany. When asked to identify a plant, focus on leaf shape, flower structure, and stem characteristics. Identify this plant based on these characteristics: ... [Plant Characteristics Description] ... Previous incorrect response focused on habitat only. Please disregard habitat and focus on morphology. Previous incorrect response focused on habitat only. Please disregard habitat and focus on morphology. Tabebuia vellosoi |
Tận dụng tối đa nội dung dài và tư duy dài
Tính năng suy nghĩ tạo ra "suy nghĩ" trong phần Đầu ra mã thông báo cho thấy lý do chi tiết của Gemini. Cách khai thác tối đa các kết quả này:
Xem xét lý do
Hãy chú ý đến quy trình suy luận của Gemini (có trong giao diện người dùng Google AI Studio), cách Gemini phân tích tác vụ và các lựa chọn mà Gemini đưa ra cho kết quả của bạn. Điều này có thể giúp bạn hiểu cách hệ thống đưa ra kết luận.
Cung cấp hướng dẫn về suy luận
Nếu muốn đầu ra đặc biệt dài, bạn nên cung cấp thêm hướng dẫn trong câu lệnh để hạn chế lượng suy nghĩ cần thiết để hoàn thành nhiệm vụ được đưa ra trong câu lệnh. Điều này cho phép bạn đặt trước nhiều Dữ liệu đầu ra của mã thông báo hơn cho phản hồi của mình.
Ví dụ: Để có báo cáo chi tiết, bạn có thể chỉ định các mục và mục phụ trong câu lệnh để hướng dẫn suy nghĩ của Gemini và sắp xếp kết quả một cách hiệu quả.
Generate a detailed report on the impact of climate change on coastal ecosystems. Report Structure: Introduction Rising Sea Levels 2.1. Impact on Mangroves 2.2. Impact on Coral Reefs Ocean Acidification 3.1. Impact on Shellfish 3.2. Impact on Plankton Extreme Weather Events 4.1. Increased Storm Intensity 4.2. Coastal Erosion Conclusion Provide detailed analysis within each section. <...> Climate Change Impact on Coastal Ecosystems: A Detailed Report 1. Introduction Coastal ecosystems, the dynamic interface between land and sea, are among the most productive and biodiverse environments on Earth. They provide crucial ecosystem services, including coastal protection, fisheries, carbon sequestration, and support for a vast array of species. However, these vital ecosystems are increasingly threatened by the multifaceted impacts of climate change. Driven by anthropogenic greenhouse gas emissions, climate change is manifesting in several interconnected ways that are profoundly altering the physical and chemical conditions of coastal environments. This report will delve into the key impacts of climate change on coastal ecosystems, focusing on rising sea levels, ocean acidification, and extreme weather events, and their specific consequences for critical habitats like mangroves and coral reefs, and key organisms like shellfish and plankton. Understanding these impacts is crucial for developing effective conservation and management strategies to mitigate the damage and enhance the resilience of these invaluable ecosystems. 2. Rising Sea Levels Rising sea levels are a direct and significant consequence of global warming, driven by thermal expansion of seawater and the melting of land ice (glaciers and ice sheets). This phenomenon poses a direct threat to low-lying coastal ecosystems by inundating habitats, altering salinity regimes, and increasing erosion rates. The rate of sea level rise is accelerating, and projections for the 21st century indicate a continued upward trend, with potentially devastating consequences for coastal environments. 2.1. Impact on Mangroves Mangrove forests are unique coastal ecosystems found in tropical and subtropical intertidal zones. They provide numerous benefits, including coastal protection against storms, nursery grounds for fish and invertebrates, and significant carbon sequestration... <...> |
Chi tiết kỹ thuật
- Các mô hình hiện có: Gemini 2.0 Flash Thinking, Gemini 2.5 Pro Experimental có tính năng suy nghĩ
- Đầu vào đa phương thức: Văn bản, Âm thanh, Hình ảnh và PDF (khả năng hỗ trợ có thể khác nhau tuỳ theo phiên bản mô hình cụ thể)
- Kết quả: Chỉ văn bản (phản hồi cuối cùng)
- Nhập mã thông báo: Ngữ cảnh dài, có thể lên đến 1 triệu mã thông báo (xem tài liệu về mô hình cụ thể)
- Đầu ra mã thông báo: Tối đa 64.000 mã thông báo (xem tài liệu về mô hình cụ thể)
LƯU Ý: Tổng đầu ra mã thông báo bao gồm cả "suy nghĩ" của mô hình và phản hồi. Tuỳ thuộc vào độ phức tạp của yêu cầu và việc sử dụng các công cụ, độ dài tối đa của kết quả phản hồi cuối cùng có thể khác nhau.
Bằng cách triển khai các kỹ thuật và tận dụng các công cụ này, các mô hình Tư duy Gemini có thể hỗ trợ bạn giải quyết nhiều nhiệm vụ phức tạp và có thể giúp cải thiện kết quả.
Các bước tiếp theo
- Giờ đây, khi đã hiểu rõ về cách thiết kế câu lệnh, hãy thử viết câu lệnh của riêng bạn bằng Google AI Studio.
- Để hiểu rõ hơn về thiết kế lời nhắc, hãy xem chủ đề chiến lược lời nhắc.
- Để tìm hiểu về lời nhắc đa phương thức, hãy xem phần Lời nhắc bằng tệp phương tiện.