AWS nova documentation change
Summary
Updated documentation for chain-of-thought prompting, including formatting changes, expanded prompt templates, and guidance for Amazon Nova Premier model usage. Added structured examples and warnings about token usage trade-offs.
Security assessment
The changes focus on improving clarity, adding examples, and optimizing prompt engineering techniques. While they discuss computational costs and output token management, there is no evidence of addressing security vulnerabilities or introducing security-specific features. The modifications are purely related to usability and performance considerations.
Diff
diff --git a/nova/latest/userguide/prompting-chain-of-thought.md b/nova/latest/userguide/prompting-chain-of-thought.md index 7ae72a32d..0468d9cb8 100644 --- a//nova/latest/userguide/prompting-chain-of-thought.md +++ b//nova/latest/userguide/prompting-chain-of-thought.md @@ -5 +5 @@ -# Give Amazon Nova time to think (chain of thought) +# Give Amazon Nova time to think (chain-of-thought) @@ -13 +13 @@ The easiest way to prompt Amazon Nova models to think is by adding instructions -Chain of thought is recommended for several of reasons, some of them are highlighted below: +Chain-of-thought is recommended for several of reasons, some of them are highlighted below: @@ -15 +15 @@ Chain of thought is recommended for several of reasons, some of them are highlig - * **Improves the Accuracy:** Giving Model chance to first do the thinking before responding, helps model land at a better answer, as compared to asking model directly to think. + * **Improves accuracy:** Giving the model a chance to first do the thinking before responding helps the model land at a better answer, as compared to asking model directly to think. @@ -17 +17 @@ Chain of thought is recommended for several of reasons, some of them are highlig - * **Improves Debugging Process:** Sometimes chain of thought reasoning helps debug where and why model made some errors. This feedback is essential to understand how to iterate on prompt to improve the flaws in models reasoning. + * **Improves the debugging process:** Sometimes chain-of-thought reasoning helps debug where and why model made some errors. This feedback is essential to understand how to iterate on prompt to improve the flaws in models reasoning. @@ -22 +22 @@ Chain of thought is recommended for several of reasons, some of them are highlig -Chain of thought is not always necessary, and can induce some additional overhead. Consider not using CoT in the following scenarios: +Chain-of-thought is not always necessary, and can induce some additional overhead. Consider not using CoT in the following scenarios: @@ -24 +24 @@ Chain of thought is not always necessary, and can induce some additional overhea - * **Increased Latency and Output Tokens:** Chain of Thought can increase the latency as the model is thinking before answering, the increase latency and output tokens can also make the overall inference expensive + * **Increased latency and output tokens:** Chain-of-thought can increase the latency as the model is thinking before answering, the increase latency and output tokens can also make the overall inference expensive @@ -26 +26 @@ Chain of thought is not always necessary, and can induce some additional overhea - * **Simpler tasks don't need COT:** Not all tasks require deep chain of thought, it is generally recommended to use chain of thought in tasks such as multi-step analysis, math problems, complex reasoning tasks. + * **Simpler tasks don't need CoT:** Not all tasks require deep chain-of-thought. We generally recommended using chain-of-thought in tasks such as multi-step analysis, math problems, complex reasoning tasks. @@ -31 +31,3 @@ Chain of thought is not always necessary, and can induce some additional overhea -Prompt template for different Styles to Chain Of Though Prompting: +Prompt templates for different styles to chain-of-thought prompting: + +**Open-ended chain-of-thought** @@ -36,0 +39,2 @@ Prompt template for different Styles to Chain Of Though Prompting: +**Guiding the model's CoT direction** + @@ -43,0 +48 @@ Prompt template for different Styles to Chain Of Though Prompting: +**System-level thinking instructions for improved CoT** @@ -45,3 +50,5 @@ Prompt template for different Styles to Chain Of Though Prompting: - {{ User query}} - Think step by step first and then answer. Follow below format when responding - Response Schema: + + "system" : [{ + "text": """The Bot first thinks about the reasoning process and then provides the User with the + answer. The reasoning process is enclosed with <thinking> </thinking> and answer + enclosed with <output> </output> that is, @@ -49 +56,3 @@ Prompt template for different Styles to Chain Of Though Prompting: - ( your thinking goes here ) + + Reasoning process here + @@ -51,3 +59,0 @@ Prompt template for different Styles to Chain Of Though Prompting: - <answer> - ( your answer goes here ) - </answer> @@ -54,0 +61,14 @@ Prompt template for different Styles to Chain Of Though Prompting: + <output> + + Answer here + + </output>""" + }], + "messages": [{ + "role": "user", + "content": [{ + "text": "{{ Actual User Query }}" + }] + }] + +The Amazon Nova Premier model is a higher intelligence model in the Amazon Nova family, able to handle more complex tasks. If your tasks require advanced chain-of-thought thinking, we recommend that you utilize the preceding prompt template. This approach can help enhance the model's analytical and problem-solving abilities. @@ -56 +76 @@ Prompt template for different Styles to Chain Of Though Prompting: -By adding "think step by step" at the end, the model is primed to begin with additional thinking before jumping to the answer. +By adding "think step-by-step" at the end, the model is primed to begin with additional processing before jumping to the answer. @@ -58 +78 @@ By adding "think step by step" at the end, the model is primed to begin with add -Role | **Unoptimized Prompt** | Prompt +Role | Unoptimized prompt | Open-ended CoT prompt @@ -132 +152 @@ Ultimately, the decision should align closely with your personal financial circu -Adding these step by step guiding cues helps the model to be more structured in its thinking before arriving at the final solution +Adding step-by-step guiding cues helps the model to be more structured in its processing before arriving at its final solution. @@ -134 +154 @@ Adding these step by step guiding cues helps the model to be more structured in -Role | **Unoptimized Prompt** | Prompt +Role | Unoptimized prompt | Guided CoT prompt @@ -247,0 +268,73 @@ By following these strategies, you can streamline the development process, enhan +Amazon Nova Premier demonstrates higher intelligence compared to the other Amazon Nova models, enabling it to serve as a more capable partner. To further enhance the model's capabilities, incorporating system-level prompts can encourage broader and more nuanced processing from Amazon Nova Premier. + +Role | Unoptimized prompt | Enforced CoT in the system prompt +---|---|--- +System Prompt | | The Bot first thinks about the thought process and then provides the User with the answer. The thought process is enclosed with <thinking> </thinking> and answer is enclosed with <output> </output> i.e., <thinking>\n\n thought process here\n\n</thinking>\n\n<output>\n\n answer here\n\n</output>. +User | I'm considering two investment opportunities and would appreciate your guidance to make the best decision. Option A is a low-risk bond fund with an expected annual return of 3%, while Option B is a moderately-risky stock portfolio with an expected annual return of 7%. Given my financial goals and risk tolerance, which option would you recommend? | I'm considering two investment opportunities and would appreciate your guidance to make the best decision. Option A is a low-risk bond fund with an expected annual return of 3%, while Option B is a moderately-risky stock portfolio with an expected annual return of 7%. Given my financial goals and risk tolerance, which option would you recommend? +Assistant | When deciding between a low-risk bond fund (Option A) and a moderately-risky stock portfolio (Option B), it's important to consider your financial goals, risk tolerance, investment horizon, and current financial situation. Here's a breakdown of some key factors to consider for each option: **Option A: Low-Risk Bond Fund** **Pros:** + + * **Stability:** Bond funds typically offer more stability and predictability in returns compared to stocks. + * **Safety:** Generally considered safer, with lower volatility, making it suitable for conservative investors or those nearing retirement. + * **Income:** Bonds often provide regular interest payments, which can be useful for generating income. + +**Cons:** + + * **Lower Returns:** The expected annual return of 3% is relatively low, which may not keep pace with inflation over the long term. + * **Opportunity Cost:** You might miss out on potentially higher returns available from riskier investments. + +**Option B: Moderately-Risky Stock Portfolio** **Pros:** + + * **Higher Returns:** The expected annual return of 7% is significantly higher than the bond fund, which can be beneficial for long-term growth. + * **Growth Potential:** Stocks have historically provided higher returns over the long term compared to bonds, potentially helping you achieve larger financial goals. + +**Cons:** + + * **Volatility:** Stocks are more volatile, which means higher risk and potentially larger losses. + * **Risk Tolerance:** If you have a low tolerance for risk, this option may cause discomfort due to the potential for market fluctuations. + +**Factors to Consider:** + + * **Risk Tolerance:** + * If you prefer a safe, stable investment and are not comfortable with market fluctuations, Option A may be more suitable. + * If you're willing to accept more risk for the potential of higher returns and have a higher risk tolerance, Option B could be better. + * **Investment Horizon:** + * For short-term goals or goals that are near, it might be wiser to choose a safer option like bonds to avoid potential losses. + * For long-term goals, the higher potential growth of stocks might justify the added risk. + * **Current Financial Situation:** + * Ensure you have an emergency fund and other necessary financial safety nets before investing in more volatile stocks. + * If you're in a position to diversify your portfolio, you might combine both options to balance risk and return. + * **Inflation:** + * Consider how each option might perform against inflation. While bonds might provide income, they might not outpace inflation over time. Stocks historically have a better track record in this regard. + +**Recommendation:** + + * **Conservative Approach:** If you are risk-averse, have a short investment horizon, or are close to retirement, the low-risk bond fund (Option A) is likely the better choice. + * **Aggressive Approach:** If you have a high risk tolerance, a longer investment horizon, and the financial cushion to handle potential volatility, the moderately-risky stock portfolio (Option B) could be more advantageous. + +Ultimately, the best decision depends on your unique financial situation and goals. If you're unsure, you might also consider consulting with a financial advisor who can provide personalized advice based on your full financial profile. | <thinking> Okay, so the user is trying to decide between two investments: Option A, a low-risk bond fund at 3% annual return, and Option B, a moderately risky stock portfolio at 7%. They mentioned their financial goals and risk tolerance, but didn't specify what those are. Hmm, I need to approach this carefully. First, I should recall that investment decisions depend on the individual's risk tolerance, time horizon, financial goals, and current financial situation. Since the user hasn't given specifics on their goals or risk appetite, I can't make a definitive recommendation. But maybe I can outline the factors they should consider. Low-risk bonds are safer, so if the person needs the money soon or can't afford to lose principal, bonds make sense. Stocks have higher returns but more volatility. If their time horizon is longer, like retirement planning, maybe they can tolerate the risk for higher growth. Also, diversification is important. Maybe a mix of both? Wait, the user is asking which to choose. If they have a high risk tolerance and long-term goals, Option B. If they're risk-averse or need stability, Option A. But since they didn't specify, perhaps I should suggest evaluating their own situation. Maybe ask clarifying questions, but since I can't do that here, I need to present both sides. Another angle: expected returns vs. actual. Stocks have higher expected returns but with higher standard deviation. Bonds are more predictable. So if their financial goals require a certain income level, maybe the 7% is better, but with risk. Alternatively, maybe they need to balance. Alternatively, if inflation is higher than 3%, bonds might not keep up. But if the user's risk tolerance is low, even if stocks are better in the long run, the short-term losses could be problematic. I should also mention that past performance isn't indicative of future results. Maybe suggest they look at their investment horizon. If it's short-term (like 1-3 years), bonds are safer. Long-term (over 5-10 years), stocks might be better despite volatility. Also, consider their current portfolio. If they're already heavily in stocks, adding bonds could diversify. Or vice versa. Without knowing their existing investments, it's hard. But the user is considering these two options as is. So, the answer should probably explain the trade-offs and advise them to assess their own risk tolerance and time horizon. If they need the money soon, go with bonds. If they can wait and handle ups and downs, stocks. Maybe suggest a combination if possible. But since they're presented as two options, perhaps guide them based on typical scenarios. Wait, maybe the user is looking for a general recommendation. Since the question is which is better, but they haven't given specifics. So I need to present the pros and cons of each and then suggest that without knowing their exact situation, they should choose based on their own risk tolerance and goals. For example, if their priority is capital preservation, A. If growth is more important, B. But the answer should be tailored with that in mind. </thinking> <output> To determine the best investment, consider the following factors based on your _risk tolerance_ and _financial goals_ : + + 1. _Risk Tolerance_ : + * **Option A (Bond Fund)** : Safer, with minimal principal loss. Ideal if you prioritize stability and can't afford significant short-term volatility. + * **Option B (Stock Portfolio)** : Higher risk but potentially higher returns. Suitable if you’re comfortable with market fluctuations and have a longer investment horizon. + 2. _Financial Goals:_ + * **Short-term needs ( <5 years)**: Bonds (Option A) are preferable to avoid timing market downturns. + * **Long-term goals (e.g., retirement, 10+ years)** : Stocks (Option B) historically outperform, despite volatility. + 3. _Inflation and Growth_ : + * A 3% return may struggle to outpace inflation, eroding purchasing power over time. + * The 7% from stocks offers better growth potential but requires patience. + + + +###### Recommendation: + +_Choose Option A_ if you need liquidity, safety, or have a low risk tolerance. _Choose Option B if you seek higher growth, can tolerate risk, and have a longer timeline._ + +###### Note + +Amazon Nova Premier can sometimes enter into excessive explanations when utilizing the chain-of-thought prompting technique. This can sometimes lead the model to analyze multiple dimensions of a problem. However, this level of processing might not always be desired by the user, because it can use a large number of output tokens. To avoid driving the model towards excessive explanations, we recommended that you use the following instructions: + + + Keep your thinking brief and provide step by step thinking in <thinking> tags. + +To improve model performance, chain-of-thought prompting can be an effective technique. This approach allows the model to break down complex problems into more manageable components, consider alternative solutions, and ultimately enhance the overall quality of its output. However, it is important to note that increased use of chain-of-thought prompting can come with trade-offs, such as higher computational cost and latency due to the generation of additional output tokens. +