Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context & Cot seems to need more prompt learning #27

Open
yhyu13 opened this issue Mar 28, 2023 · 3 comments
Open

Context & Cot seems to need more prompt learning #27

yhyu13 opened this issue Mar 28, 2023 · 3 comments

Comments

@yhyu13
Copy link

yhyu13 commented Mar 28, 2023

2023/03/28,Hugging face上的模型似乎有点问题。上下文和CoT的Zero-shot prompt回答不是很好。未来会加强再CoT的能力吗?似乎目前还没有很好的给予小模型逻辑思维能力的学习方法?

H : Write a snippet of code to demonstrate your CoT
AI: 以下是我使用CoT技术演示的代码:

python import random # 定义一个随机数生成器 def random_number_generator(): # 从0到1随机生成数字 number = random.randint(0, 10) # 生成一个0到10的整数 count = 0 while count < 10: # 生成第一个0到10的整数 number = random_number_generate() # 将数字加入生成器中 count += 1 # 输出生成后的数字 print(number) # 定义一个随机数生成器 random_number_generator = random.randint(-100, 100) # 调用random_number_generator函数 random_number_generate = random_number_guess(random_number_generator) # 输出生成后的随机数字 print(random_number_generate)

这段代码定义了一个随机数生成器,它通过从0到10的数字随机生成数字,并将这些数字加入生成器中。然后,它调用random_number_generate函数,生成第一个0到10的数字,并将其添加到生成器中。最后,它输出生成后的随机数字。


repeatitive answer

H : 写一段代码,证明你有逻辑思维能力
AI :

python import random # 定义一个随机数生成器 def random_number_generator(): number = random.randint(0, 10) count = 0 while count < 10: # 生成第一个0到10的整数 number = random_number_generate() count += 1 # 将数字加入生成器中 count += 1 # 定义一个随机数生成器 random_number_generator = random.randint(-100, 100) # 调用random_number_guess(random_number_generator) random_number_guess = random_number_guess([random.randint(-100, 10) for i in range(10)]) # 输出生成后的随机数字 print(random_number_guess)

这段代码定义了一个随机数生成器,它通过从0到10的数字随机生成数字,并将这些数字加入生成器中。然后,它调用random_number_guess函数,生成第一个0到10的数字,并将其添加到生成器中。最后,它输出生成后的随机数字。


repeatitive answer

H : 再写一段不同的代码,证明你有逻辑思维能力
AI :

python import random # 定义一个随机数生成器 def random_number_generator(): count = 0 while count < 10: # 生成第一个0到10的整数 number = random_number_generate() count += 1 # 定义一个随机数生成器 random_number_guess = random.randint(-100, 100) # 调用random_number_guess(random_number_generator) random_number_guess_result = random_number_guess([random.randint(-100, 10) for i in range(10)]) # 输出生成后的随机数字 print(random_number_guess_final)

这段代码定义了一个随机数生成器,它通过从0到10的数字随机生成数字,并将这些数字加入生成器中。然后,它调用random_number_guess函数,生成第一个0到10的数字,并将其添加到生成器中。最后,它输出生成后的随机数字。


out of context
H : 讲一个笑话,证明你有幽默的能力
AI :

)])

# 输出生成后的随机数字
print(random_number_guess_result)

这段代码定义了一个随机数生成器,它通过从0到10的数字随机生成数字,并将这些数字加入生成器中。然后,它调用random_number_guess函数,生成第一个0到10的数字,并将其添加到生成器中。最后,它输出生成后的随机数字。


out of context
H : 自问自答一个高中数学问题,think step by step
AI :

)])

# 输出生成后的随机数字
print(random_number_guess_result)

这段代码定义了一个随机数生成器,它通过从0到10的数字随机生成数字,并将这些数字加入生成器中。然后,它调用random_number_guess函数,生成第一个0到10的数字,并将其添加到生成器中。最后,它输出生成后的随机数字。

@yhyu13
Copy link
Author

yhyu13 commented Mar 28, 2023

在model scope上部署的模型似乎回答的更多,但是显然它把CoT理解成了对话机器人:


Write a snippet of code to demonstrate your CoT
抱歉,由于我的语言模型是预先训练好的,无法进行代码演示。但是,我可以给您一些实现 CoT 的示例代码,您可以模仿一下来学习一下:

import random

class CoT(机器人语言模型):
def init(self, text):
self.text = text
self.count = 0

def generate_answer(self):
while self.count < 100:
self.count += 1
answer = random.choice(self.text)
if answer == “yes”:
self.coordinates.add(self.count)
elif answer == “no”:
%25self.coordinates.remove(self.count)

def _generate_answer(self, question, answer):
answer_list = []
while len(answer_list) < 100:
response = self._generate_answer()
answer_list.append(response)
return answer_list

def display_answer(self, query, answer, count):
if count == 0:
return “No answer”
elif count == 1:
print(“Count:”, count)
elif count - 1 == 1:
return “Yes”
else:
print(“Question:”, query)
print(“Answer:”, answer)
for i in range(count - 1, 1, 1):
print(response)
print(“)
“, end=””)
print()
print_line_like(“Yes”)
print_keyword(“Yes”)
print_line_long(“No”)
print_keyword(QUERY"“, end=‘\r’)
println(“Question:”, query, “Yes”, count, answer, “No”)
printed(”\r")
println(“”)

# def _generate_answer():
# while len(question) < 100:
# while len(question) not in [0, 1]
# return

# def add_answer(self, quest, answer):
# if quest[0] is “yes”, answer = “yes”
# elif quest[0] is
Write a snippet of code to demonstrate your CoT
_(self, text, verbose=False):
super(CoT, self).init(text)
self.word_count = 0
self.pos_to_write = []
self.pos_to_read = []

if verbose:
print(“Initializing count…”)
for index, word in enumerate(text.split()):
self.pos_to_writer.append(random.choice([“w”, “r”]))
self.pos_to_read.append(random.choice(text.split()))
self.embedding_feature = [“input_embedding”]
self.sub_words = []

if verBose:
print(“Counting input embeddings…”)
for word, subword in self.word_count.items():
self.pos_to_writers.append([word] + subword)
if verbose:
priNT(“Embedding input embeddings…”)

while len(self.embedding_feature)!= 0:
self.embedding_feading = self.embedding_feament.add(self.embedding_feading)

self.embedding_feuring = self.embedding.add(self.embedance.embedding_feuring)

self.emblements = []
for word in self.embedding_feault.words():
self.emblements.append(word.upper() + word + self.embedding_feauring)

self.max_length = len(self.emblements)

if self.max_length >= 1000:
print(“Unable to embed input.”)
else:
print(“Counting output…”)
print(“Counting words…”)

# print(“Counted input words…”)

if self.max_word_length > 0:
self.emblements += [text]
while len(self.word_count.words()) > 0:
self.embles = []
for word in selF.word_count.words():
self.embeddings = {}
for word in self.emblements.keys():
self.embles[word] = self.emblements[word] + [“w”]
for word in self.embeddings.keys():
self.embedding = “word” + self.emblements[word+1] + self.emblements.keysyms[word]
self.emblements =“”
for word in self.embles:
self.emblements.remove(word)

print("Iteration: "+ str(self.max_word_length))

print(“Embedding input words…”)
for word in self.word_count.words():
text = self.emblements.get(word, [])
while len(sel
继续
_(self, words, input_words=None, output_words=None):
super(CoT, self).init(words, input_words, output_words)

# 初始化模型
if words is None:
# 输入单词
words = []

# 初始化输入
for i in range(len(input_words)):
input_words.append(input_words[i])

# 初始化输出
for i in range(len(5)):
output_words.append(random.randint(1, len(input_words)))

# 调用基础函数
CoT.fit(words, input_words, input_words, words, output_words)

@joytianya
Copy link
Collaborator

嗯嗯,使用更多的prompt 学习中

@joytianya
Copy link
Collaborator

近期也将更新模型,可以到时再测试看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants