# GPT iterative reasoning 實驗 (2012 Umbu-Ungu)
### 實驗方法參考
[Chain-of-Thought/ Self-Consistency 論文導讀](https://hackmd.io/@chrizeroxtwo/SkaL8PUE3)
參考了Google Brain Team 的 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 和 Self-consistency improves chain of thought reasoning in Language Models。
其中第一篇paper中有提到:
>A chain of thought provides an interpretable window into the behavior of the model, suggesting how it might have arrived at a particular answer and providing opportunities to debug where the reasoning path went wrong (==although fully characterizing a model’s computations that support an answer remains an open question==)
>>Chain-of-Thought可以圖像化模型的解題思路,讓debug時有更有機會找出問題所在 (==注意:使模型完整歸納其運算過程的方法還待研究==)
#### 跟研究的iterative reasoning尋找一個spell使其能output出reasoning steps一致
參考paper後,我也採用Chain-of-thought prompting,當然,針對不同語奧問題的Chain-of-thought還需要更多的討論與設計,但數字題的Chain-of-thought我認為可以以中文的數字系統作為one-shot examplar,以中文的十進位制作為語言模型處理未知語言的進位時的參照。
## Umbu-Ungu語的數字題
### 2012 IOL Problem 2

形式同Rosetta Stone的形式,亦是列出阿拉伯數字和其對應在Umbu-Ungu語中的表達方法。同時,也有列出提示telu < yepoko,依其出現的位置判斷,可能是較小的數字單位(即不是進位的base),而題目要求就是將指定的Umbu-Ungu數字轉換成阿拉伯數字,再將幾個阿拉伯數字轉換成Umbu-Ungu的表達式。
### GPT解題實驗
#### 先prompt ChatGPT確認語奧在其認知範疇中

#### 確認語奧數字題在ChatGPT的認知範疇

ChatGPT也有提到他有認知到不同的語言的數字系統可能會有不同的base(如12進位)和更複雜的數字系統。

>In Mandarin, it expresses numbers in decimal, for instance, it expresses 10 in '十', then as the number exceeds 10, like 11, it just add one more Mandarin character to the right side (when written in left to right format) which corresponds to 1, '一' , make it '十一' to represent 11. As for Umbu-Ungu, I would like to guess it also use some sort of Positional notation with a certain base(not exactly to be 10), please read the following known information about number system in Umbu-Ungu, find the rule of the system and give me your reasoning path.
In Umbu-Ungu:
The number telu is smaller than yepoko, namely telu < yepoko.
Here are some of the numbers expressed with Umbu-Ungu (Please note that these ate not all numbers in Umbu-Ungu)
10 rureponga talu
15 malapunga yepoko
20 supu
21 tokapunga telu
27 alapunga yepoko
30 polangipunga talu
35 tokapu rureponga yepoko
40 tokapu malapu
48 tokapu talu
50 tokapu alapunga talu
69 tokapu talu tokapunga telu
79 tokapu talu polangipunga yepoko
97 tokapu yepoko alapunga telu


#### 首先ChatGPT重複了一遍Umbu-Ungu的數字,歸納出了幾個pattern:
:::info
*#Output of ChatGPT*
1. tokapu看起來像是base或是數字分組,**它出現在數字的主要部分之前**
2. "rureponga," "malapu," "supu," 和 "polangipunga" 與base的倍數或數字分組有關。
3. "talu," "yepoko," 和 "telu" 似乎是表示特定的數字。
4. 數字的組成看起來是由左到右的模式
:::
比對
10 **rureponga** ==talu==
15 malapunga ==yepoko==
20 **supu**
21 tokapunga ==telu==
27 alapunga ==yepoko==
30 **polangipunga** ==talu==
35 **tokapu** **rureponga** ==yepoko==
40 **tokapu** **malapu**
48 **tokapu** ==talu==
50 **tokapu** alapunga ==talu==
69 **tokapu** ==talu== tokapunga ==telu==
79 **tokapu** ==talu== **polangipunga** ==yepoko==
97 **tokapu** ==yepoko== alapunga ==telu==
有出現在ChatGPT初步分析的**base**以**粗體表示**,==特定數字==以==螢光表示==。
ChatGPT漏掉了幾個在Umbu-Ungu數字examplar的數字表達:
- 出現一次的 malapunga(有猜測malapu)
- 出現兩次的 tokapunga(有猜測tokapu)
- 出現三次的 alapunga
其餘的猜測觀念都是正確的,包含"talu," "yepoko," 和 "telu"可能是特定數字的猜測,其餘數字的分組,組成的格式是從左到右等。
::: danger
*#Output of ChatGPT*
基於以上的觀察,可以提出以下的推理過程:
1. base或分組單位:「tokapu」出現在數字的主要組成部分之前。
2. 倍數:「rureponga」、「malapu」、「supu」和「polangipunga」用於表示基數的倍數或分組。
1. "rureponga" 可能代表 5 的倍數。
2. "malapu"可能代表 10 的倍數。
3. "supu"可能代表 20 的倍數。
4. "polangipunga"可能代表 30 的倍數。
3. 特定數字:「talu」、「yepoko」和「telu」用於表示特定的數字。
1. "talu"可能代表數字 1。
2. "yepoko"可能代表數字 2。
3. "telu" 可能代表數字 3。
4. 從左到右的模式:數字的組成部分按照從左到右的順序結合以表示所需的數值。
根據以上初步觀察和假設,我們可以嘗試解釋所給出的例子並預測其他數字。例如:
"27: alapunga yepoko" 可以解釋為 "兩組十再加上二",對應的數字是27。
"69: tokapu talu tokapunga telu" 可以解釋為 "一組六十再加上三",對應的數字是69。
通過分析更多的例子並測試我們的假設,我們可以逐步完善對於 Umbu-Ungu 數字系統的理解,並可能發現更多的規律。
:::
以上ChatGPT的推理則是錯誤百出,除了對於base的猜測、沒有解釋'tokapu'的作用,還有在prompting時已經列出
>The number telu is smaller than yepoko, namely telu < yepoko.
ChatGPT仍判斷'telu'是3而'yepoko'是2,因此我強調了yepoko 比 telu大 的事實
>In the initial prompting of number system of Umbu-Ungu I already stated that:
"The number 'telu' is smaller than 'yepoko', namely telu < yepoko."
Yet one of your reasoning indicates that:
The specific numbers: "talu," "yepoko," and "telu" are
...
So I revise my prompt:
**The number 'yepoko' is larger than 'telu'.**
ChatGPT給出了revised的reasoning

仍然是錯的QQ 甚至強調自己已經考慮了 correction: "yepoko" is larger than "telu".
因此決定再prompting,連同前面漏掉的可能的數字單位malapunga, tokapunga, alapunga,沒有解釋的tokapu:
>The multiples of the base or grouping in your reasoning missed the discussion on the function of 'malapunga', 'tokapunga' and 'alapunga', and did not explain what 'tokapu' exactly means, please consider this in the reasoning.
Also, please consider the fact that 'yepoko' is larger than 'telu'.
對於telu 跟 yepoko的關係仍然沒有修正外,ChatGPT給出了以下的revised output:

全文如下:
::: info
額外(數字)組成:
與其他數字結合時,「malapunga」可能表示額外的十的單位(單數)(10)。
與其他數字結合時,「tokapunga」可能表示額外的十的群組(複數)(10)。
與其他數字結合時,「alapunga」可能表示額外的二十的群組(20)。
現在,根據這些修正,讓我們重新分析所給的例子:
「10:rureponga talu」可以解讀為「五的一群」,對應於數字5。()
「15:malapunga yepoko」可以解讀為「十的一群加二」,對應於數字12。
「20:supu」可以解讀為「一個二十的群」,對應於數字20。
「21:tokapunga telu」可以解讀為「十的兩群加三」,對應於數字23。
「27:alapunga yepoko」可以解讀為「二十的一群加二和七」,對應於數字27。
「30:polangipunga talu」可以解讀為「三十的一群」,對應於數字30。
「35:tokapu rureponga yepoko」可以解讀為「十的三群加五和二」,對應於數字52。
「40:tokapu malapu」可以解讀為「十的四群」,對應於數字40。
「48:tokapu talu」可以解讀為「十的四群加三」,對應於數字43。
「50:tokapu alapunga talu」可以解讀為「十的五群加二和三」,對應於數字53。
「69:tokapu talu tokapunga telu」可以解讀為「十的六群加一,十的一群,和三」,對應於數字73。
「79:tokapu talu polangipunga yepoko」可以解讀為「十的七群加一,十的三十群,和二」,對應於數字92。
「97:tokapu yepoko alapunga telu」可以解讀為「十的九群加二十,和七」,對應於數字97。
藉由這個修正後的推理過程,我們現在可以準確地分析和解讀所給的例子,考慮到Umbu-Ungu數字系統中「telu」和「yepoko」之間的修正關係。
:::
不只左側的Umbu-Ungu的解讀大部分都是錯誤的,右側用GPT自己推測出來的數字加法本身也有問題QQ,右側加對的數字推理過程也是錯的,目前的推理過程感覺行不通了,可能需要大幅修改Prompting形式再次測試。
Umbu-Ungu語的數字系統運作如下圖:

是24進位的系統(tokapu代表24),以4為一個小迴圈計算,對於表示一個cycle到下一個cycle之間的數字(如左側表示12到32的數字),會以下一個進位減去4再加上1~3之間的數字表示,對大於已有的左側數字表示會以相加的方式,亦即兩個數字擺在一起表示相加,會先是24based(24/48/72),右側是任意的小cycle(除了tokapu:24以外)
### 將已經破解出來的Umbu-Ungu數字系統規則prompt給GPT,以CoT測試其對題目的解題能力?
::: info
Here's the basic rules of Number System of Umbu-Ungu:
In Umbu-Unbu,
telu is 1
talu is 2
yepoko is 3
rurepo is 12
malapu is 16
supu is 20
tokapu is 24
alapu is 28
polangipu is 32
tokapu talu is 24 * 2 = 48
tokapu yepoko is 24 * 3 = 72
In the description below, a,b,d,k represent a Umbu-Ungu number
‘a’ with a postfix ‘nga’, namely, ’a-nga’ stands for (a-4)
And a-nga b means (a-4)+b
a can be {12, 16, 20, 24, 28, 32}.
b can be {1,2.3)
c is in ‘tokapu k’ format, and k can be {1,2,3}, tokapu k means 24 * k
tokapu k d means tokapu k + d
d can be any number between 9~32 except 24.
Using the rules above, we can explain the number in the examplars:
tokapu yepoko alapunga telu is 24 * 3 + (28-4)(alapu-nga) + 1 = 72 + 24 + 1 = 97
tokapu talu tokapunga telu is 24 * 2 + (24-4)(tokapu-nga) + 1 = 48 + 20 + 1 = 69
please harness the rule to solve the problems below:
(a) Write in numerals:
tokapu polangipu
tokapu talu rureponga telu
tokapu yepoko malapunga talu,
tokapu yepoko polantipunga telu.
(b) Write out in Umbu-Ungu: 13; 66; 72; 76; 95.
:::

### 5/26老師meeting建議
---
- 給GPT答案 / 可能一個正確 一個錯誤,問他怎們導到正確答案
- 給他好多個rosetta stone形式的 pair 增加數目來測試他的表現
- tree of thought