1 of 17

CoT in linear inequalities in one unknown

2 of 17

2. What is "Chain of Thought" Prompt Engineering?

Chain of Thought (CoT) is a technique we can use to improve the LLMs' performance on certain tasks. 

Instead of asking the LLM a question directly, we break down the problem into smaller parts, and guide the model through solving each part step by step. 

This method can help the model generate more accurate answers, and it allows us to understand the problem-solving process more clearly.

Chain-of-Thought Prompting Elicits Reasoning in Large Language Models https://arxiv.org/pdf/2201.11903.pdf  -  "enables" reasoning capabilities of the LLM through intermediate steps of reasoning

3 of 17

�2. Example of how CoT Prompt Engineering works (Linear Inequalities)

   Example 1:  If x<0, determine if the inequality x/6 < -x/5 is true. 

Answer:      x/6 > -x/5  <=>  (30)* x/6 <  (30)*(-x/5)   

                                          <=>   5x < -6

                                          <=>   11x < 0 

                                           <=>    x < 0 

Therefore,  the inequality x/6 < -x/5 is TRUE if x<0! 

Therefore, TRUE!

4 of 17

Let's see if ChatGPT gets it correct?

Putting O-G into ChatGPT, get

FALSE

which is wrong!

ChatGPT shareable link: 

https://poe.com/s/vF9cOrHZxedfW3SPy74P  

Where did it go wrong?

5 of 17

Example:

Consider teaching the LLM how to solve a "similar problem":

i.e., Example 2: 

If x<0, determine if the inequality x/5 > -x/4 is true.

Let's produce the model answer:

To determine if the inequality x/5 > -x/4 is true for x < 0, we can follow these steps:

    • Understand the inequality:

The inequality given is x/5 > -x/4.

2. Multiply through by 20 (the least common multiple of 5 and 4) to clear the fractions:

This gives 4x > -5x.

3. Move terms involving x to one side of the inequality:

This gives 4x + 5x > 0 which simplifies to 9x > 0.

4. Solve the resulting inequality:

This gives x > 0.

Now, let's consider the domain we are interested in: x < 0. The inequality x > 0 doesn't have any solutions in the domain x < 0. Therefore, the inequality x/5 > -x/4 is not true for x < 0.

Use the above example to "train" the LLM on how to solve these problems, step by step

6 of 17

Plug (Q, A, Q) into ChatGPT:

https://poe.com/s/hMvHWreMVnKZMvBwsRcK  

Got it CORRECT!!!

Because we "trained/taught" the LLM how to solve such problems, step by step.

7 of 17

3. Is ChatGPT answer correct?

Example 3:  If x<0, determine if the inequality 

3/x > 1/x

Is true?

Option to use Badaboom! Or just Raise Hands!

8 of 17

3. Is the following ChatGPT answer correct?��https://poe.com/s/SCQUASGdqmIoKEEg0O3y   

Go to:​

  • https://playbadaboom.com/  and  ​

“Enter Game Code” (four letters and numbers) or​

  • Scan QR code given​
  • Or go to direct link given by Teacher in chatroom​

Option to use Badaboom! Or just Raise Hands!

9 of 17

3. Is the following ChatGPT answer correct?��https://poe.com/s/SCQUASGdqmIoKEEg0O3y   

Answer is WRONG!  

10 of 17

3. Is the following ChatGPT answer correct?��https://poe.com/s/SCQUASGdqmIoKEEg0O3y   

Where did it go wrong?  

11 of 17

3. CORRECT answer�

                  

Question:             If x<0, determine if the inequality  3/x > 1/x  is true? 

Answer:

FALSE!!  Here is a counter example:  

If x=-1, then  3/(-1) > 1/ (-x)    <=>   -3 > -1, which is FALSE!!  

12 of 17

4. Using CoT to get LLM to get the correct answer 

Example 4: 

It is given that a < b < 0. Determine whether each of the following inequality is true.

(a+5)/2 > (b+5)/2

Answer:   To get an idea, if (a+5)/2 > (b+5)/2 is true, then

(a+5)/2 > (b+5)/2  <=>  a/2 + 5/2 > b/2 + 5/2

                                 <=>   a/2 > b/2

                                 <=>   a>b

                   

Therefore,  it doesn't seem like its true.  So, we'll find a counterexample.  

Choose a=-2, b=-1 so that a<b<0.  Then (a+5)/2 > (b+5)/2 <=> ((-2)+5)/2 > ((-1)+5)/2

                                                                                                       <=> 3/2 > 4/2=2, which is WRONG!

Therefore, the inequality (a+5)/2 > (b+5)/2 is FALSE! If a < b < 0.

13 of 17

4. Using CoT to get LLM to get the correct answer 

LLM answer WRONG

14 of 17

4A. Using CoT to get LLM to get the correct answer (Teacher suggested CoT)

Example 5:   It is given that a < b < 0. Determine whether each of the following inequality is true.                                  

                                                               (a+3)/7 > (b+3)/7

  • Please scan the QR code or go to the following URL to write down your answer in text:

2. Plug your answer into your LLM Google PaLM in the form of (Q, A, Q) to see if you got the right answer.  First one who posts on YoTeach! Wins!

15 of 17

4. Using CoT to get LLM to get the correct answer�(Teacher suggested CoT)

Correct (CoT-Q, CoT-A, O-Q)

16 of 17

4. Using CoT to get LLM to get the correct answer�(Teacher suggested CoT)

f 

Note: Students can post up a screenshot, or a poe.com sharelink to the ChatGPT prompt and answer, and

It is TIME-STAMPED, so you know who posted first!

17 of 17

Questions?

Please contact either

  • Dr. Carter LAM (lamwh@eduhk.hk)
  • Dr. Fridolin TING (fridolin@eduhk.hk)

for any further questions, comments or feedback.