ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Competition-Level Code Generation with AlphaCode

2022-02-03 23:03:19  阅读:299  来源: 互联网

标签:AlphaCode Code string Generation character Backspace letter press instead


这是篇论文: competition_level_code_generation_with_alphacode.pdf

Backspace

You are given two strings s and t, both consisting of lowercase English letters. You are going to type the string s character by character, from the first character to the last one.

When typing a character, instead of pressing the button corresponding to it, you can press the "Backspace" button. It deletes the last character you have typed among those that aren't deleted yet (or does nothing if there are no characters in the current string). For example, if s is "abcbd" and you press Backspace instead of typing the first and the fourth characters, you will get the string "bd" (the first press of Backspace deletes no character, and the second press deletes the character 'c'). Another example, if s is "abcaa" and you press Backspace instead of the last two letters, then the resulting text is "a".

Your task is to determine whether you can obtain the string s, if you type the string s and press "Backspace" instead of typing several (maybe zero) characters of s.

"量子位"对上文的翻译是:如果按下Backspace键,就删除该光标前到上一个未删除字符之间的所有字符。例如字符串s是"abcbd",你分别在第一个位置和第四个位置按下Backspace,那么将得到字符串"bd"。因为在第一个光标位置前没有字符,所以第一次没有动作。第四个光标位置前的字符是c,上一个未删除字符是a,所以按下Backspace将删除前三个字符"bd"。这一翻译是错的

It deletes the last character, "the last character"是单数,按Backspace每次删一个字符而不是多个字符。among those that aren't deleted yet, among是在...之中。这句话比较啰嗦,意思是你只能删除你已经输入的字符。

if s is "abcbd" and you press Backspace instead of typing the first and the fourth characters. 你的输入是: <退格> b c <退格> d,结果是bd. 即:照着s输入,每一步可以按字母键或者退格键。按了退格键就跳过字母键不按。如第一次按退格键,跳过a不按,第二次按b键。论文后面说了:Backspace deletes two letters. The letter you press backspace instead of, and the letter before it.

该python程序用input()读入两个字符串后把它转成了list,其实可以用x=list('abc')的方式来转换。list的reverse是in place操作,如x.reverse()后x成为['c', 'b', 'a']. help(str)可看到string的帮助信息。string没有reverse函数。列表c是多余的。

论文中说:
1. The problem is to figure out if it is possible to convert one phrase to another by pressing backspace instead of typing some letters. So first we read the two phrases (lines 3-4).
2. If the letters at the end of both phrases don't match, the last letter must be deleted. If they do match we can move onto the second last letter and repeat. [好像可以用分治法/小目标来解释。n-1个退格和1个字符是合法的。]
3. Backspace deletes two letters. The letter you press backspace instead of, and the letter before it (19-20).
4. If we matched every letter, it is possible to obtain string t from s (23-26).

Our pre-training dataset is based on a snapshot of selected public GitHub repositories taken on 2021/07/14... After filtering, our final pre-training dataset contains a total of 715.1 GB of code.

我随便在python里找了个D:\Python39\Lib\email\message.py, 48K, 1174行,即每行42个字节。也许可以说AlphaCode看了17G行,即170亿行!代码。

The competitive programming code generation problem can be viewed as a sequence-to-sequence (Sutskever et al., 2014) translation task: given a problem description X in natural language, produce a corresponding solution Y in a programming language. This naturally motivates the choice of an encoder-decoder transformer architecture (Vaswani et al., 2017) for AlphaCode, which models p(Y|X).

论文作者是:Yujia Li*, David Choi*, Junyoung Chung*, Nate Kushman*, Julian Schrittwieser*, Rémi Leblond*, Tom Eccles*, James Keeling*, Felix Gimeno*, Agustin Dal Lago*, Thomas Hubert*, Peter Choy*, Cyprien de Masson d’Autume*, Igor Babuschkin, Xinyun Chen, Po-Sen Huang, Johannes Welbl, Sven Gowal, Alexey Cherepanov, James Molloy, Daniel J. Mankowitz, Esme Sutherland Robson, Pushmeet Kohli, Nando de Freitas, Koray Kavukcuoglu and Oriol Vinyals. *代表Joint first authors.

https://yujiali.github.io/
Education / Work Experience
2020.11 - present Staff Research Scientist, DeepMind.
2018.5 - 2020.11 Senior Research Scientist, DeepMind.
2016.11 - 2018.5 Research Scientist, DeepMind.
2013.2 - 2017.2 Doctor of Philosophy, University of Toronto.
2015.6 - 2015.9 Research Intern, Microsoft Research Cambridge.
2014.6 - 2014.9 Research Intern, Microsoft Research Redmond.
2011.9 - 2013.1 Master of Science, University of Toronto.
2011.6 - 2011.8 R&D Intern, Baidu, Inc..
2007.8 - 2011.7 Bachelor of Engineering, Tsinghua University.

唉,某些国内媒体对国外AI进展的跟踪有点像电影《星球大战》里的浣熊人:“哇塞,光剑又出新版了,好好耶!” 会造光剑不?卖萌能行不?:-)

 

吓得我赶紧下了本"Linux Kernel Development" :-). Execute操作系统倒也罢了,怎么evaluate它?

标签:AlphaCode,Code,string,Generation,character,Backspace,letter,press,instead
来源: https://www.cnblogs.com/funwithwords/p/15862203.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有