﻿{"id":72,"date":"2021-12-27T09:57:05","date_gmt":"2021-12-27T04:27:05","guid":{"rendered":"https:\/\/blogs.infosys.com\/digital-experience\/?p=72"},"modified":"2021-12-27T09:57:05","modified_gmt":"2021-12-27T04:27:05","slug":"introduction-to-open-ai-codex","status":"publish","type":"post","link":"https:\/\/blogs.infosys.com\/digital-experience\/emerging-technologies\/introduction-to-open-ai-codex.html","title":{"rendered":"Introduction to Open AI &#8211; Codex"},"content":{"rendered":"<p><strong>OpenAI Codex<\/strong> is an Artificial Intelligence system that was created by San Francisco-based AI research lab &#8211; OpenAI. Codex, which is the model that powers GitHub Co-Pilot, handles code generation via Natural Language Processing (NLP). Currently Codex is in closed beta phase and can be accessed through an API which is limited. OpenAI Codex is based on GPT-3 which had more focus on natural language than coding.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-79\" src=\"https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/uploads\/2021\/12\/ai-1.jpg\" alt=\"AI\" width=\"525\" height=\"350\" srcset=\"https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/uploads\/2021\/12\/ai-1.jpg 800w, https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/uploads\/2021\/12\/ai-1-300x200.jpg 300w, https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/uploads\/2021\/12\/ai-1-768x512.jpg 768w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>According to OpenAI team, Codex is supposed to be an advanced version of GPT-3, focusing mainly on coding. GPT-3 is mainly a neural network that is trained on natural language, Codex has undergone an additional training on 159 GB of Python code from approximately 50+ million GitHub repositories that are publicly available. OpenAI claims that, although Codex is best suited for Python, it is well equipped to function in over a dozen programming languages as well:<\/p>\n<ul>\n<li>Go<\/li>\n<li>JavaScript<\/li>\n<li>Perl<\/li>\n<li>PHP<\/li>\n<li>Ruby<\/li>\n<li>Shell<\/li>\n<li>Swift<\/li>\n<li>TypeScript<\/li>\n<\/ul>\n<p>OpenAI Codex can be used for a wide range of functions like:<\/p>\n<ul>\n<li>Generation of code through comments<\/li>\n<li>Code completion<\/li>\n<li>Generation of comments in existing project base.<\/li>\n<li>Refactoring code<\/li>\n<li>Translation of code from one language to another<\/li>\n<\/ul>\n<p>A complete list of examples can be found here: <a href=\"https:\/\/beta.openai.com\/examples\">https:\/\/beta.openai.com\/examples<\/a><\/p>\n<h4><strong>Available Models<\/strong><\/h4>\n<p>There are two models currently available under OpenAI Codex engine:<\/p>\n<ul>\n<li><strong>davinci-codex<\/strong> \u2013 This is the model with the most capability and supposed to be good in translating natural language to code. Supports up to 4096 tokens in beta phase.<\/li>\n<li><strong>cushman-codex<\/strong> \u2013 This model is the fastest one in terms of the speed in which the requests are processed, however this is not as capable as davinci-codex. Supports up to 2048 tokens in the current beta phase.<\/li>\n<\/ul>\n<h4><strong>Accessing Codex API<\/strong><\/h4>\n<p>In the current beta phase, OpenAI Codex can be accessed through:<\/p>\n<ul>\n<li><strong>API<\/strong> \u2013 API keys can be generated and used from your development environment<\/li>\n<li><strong>Playground<\/strong> \u2013 OpenAI team has provided a User interface in which one can set the required parameters and consume the API which is very helpful<\/li>\n<\/ul>\n<h4><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-85 size-thumbnail\" src=\"https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/themes\/infosys-blog\/images\/Sample-Image.jpg\" alt=\"Playground-OpenAI-API\" width=\"150\" height=\"150\" srcset=\"https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/themes\/infosys-blog\/images\/Sample-Image.jpg 150w, https:\/\/blogs.infosys.com\/digital-experience\/wp-content\/uploads\/2021\/12\/Playground-OpenAI-API-38x38.png 38w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/h4>\n<h4><strong>Training<\/strong><\/h4>\n<p>Codex has provided a way to train the model where in, the expected output to a problem statement can be passed thereby training the model. As per OpenAI team, the more training examples you have, the better. It is recommended to having at least a couple hundred samples. In general, only a doubling of the dataset size leads to a significant increase in model quality.<\/p>\n<h4><strong>Guidelines<\/strong><\/h4>\n<p>OpenAI is not open source and every project that is being built will be evaluated separately by the team. And those applications that go through will be able to consume the APIs for public use. You can read more on the guidelines here: <a href=\"https:\/\/beta.openai.com\/docs\/usage-guidelines\/use-case-guidelines\">https:\/\/beta.openai.com\/docs\/usage-guidelines\/use-case-guidelines<\/a><\/p>\n<h4><strong>What to expect<\/strong><\/h4>\n<p>Although the Codex models have been trained in over millions of lines of code and still continuously learning with the help of the community, the results are not 100% accurate. However, OpenAI Codex doesn\u2019t have any competitor that is remotely close to being capable of doing what Codex does today.<\/p>\n<p>OpenAI has come a long way from being founded by Elon Musk, Sam Altman, and others in 2015 to getting a billion-dollar investment from Microsoft in 2019. With the release of Github CoPilot, the future of Open AI and Codex looks very promising.<\/p>\n<h4><strong>Reference<\/strong>:<\/h4>\n<ul>\n<li><a href=\"https:\/\/openai.com\/blog\/openai-codex\">https:\/\/openai.com\/blog\/openai-codex<\/a><\/li>\n<li><a href=\"https:\/\/beta.openai.com\/docs\/introduction\/key-concepts\">https:\/\/beta.openai.com\/docs\/introduction\/key-concepts<\/a><\/li>\n<li><a href=\"https:\/\/beta.openai.com\/examples\">https:\/\/beta.openai.com\/examples<\/a><\/li>\n<li><a href=\"https:\/\/beta.openai.com\/playground?model=davinci-codex\">https:\/\/beta.openai.com\/playground?model=davinci-codex<\/a><\/li>\n<li><a href=\"https:\/\/beta.openai.com\/docs\/engines\">https:\/\/beta.openai.com\/docs\/engines<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/OpenAI\">https:\/\/en.wikipedia.org\/wiki\/OpenAI<\/a><\/li>\n<\/ul>\n<p>Looking forward to your comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenAI Codex is an Artificial Intelligence system that was created by San Francisco-based AI [&hellip;]<\/p>\n","protected":false},"author":169,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[4],"tags":[36,35],"coauthors":[34],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-emerging-technologies","tag-davinci-codex","tag-openai-codex"],"acf":[],"_links":{"self":[{"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/users\/169"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":10,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/posts\/72\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/tags?post=72"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.infosys.com\/digital-experience\/wp-json\/wp\/v2\/coauthors?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}