AWS CodeWhisperer creates computer code from natural language

At re:Invent, AWS announces that the CodeWhisperer preview has added support for two new programming languages.

Update, 4/14/23: Yesterday, Amazon Web Services announced the general availability of CodeWhisperer, with a free tier for individual use.

Generative AI systems have acquired capabilities previously unimaginable, such as producing reams of plausibly human text, summarizing complicated documents, suggesting novel drug formulations, or creating works of art inspired by any number of human artists or styles. Now, large language models, a form of generative AI, have been brought to bear on the very technology that underpins them: computer coding.

Related content
Automated-reasoning method enables the calculation of tight bounds on the use of resources — such as computation or memory — that results from code changes.

Amazon CodeWhisperer is a new cloud-based capability provided by Amazon Web Services that uses machine learning and large language models to make developers’ lives easier and boost their productivity.

CodeWhisperer works within a developer’s primary workspace, known as an integrated development environment (IDE). As developers build their code, they typically leave notes or comments in natural language describing, for example, the purpose of the next block of code or, indeed, the overall purpose of the program. The system looks at not only the code already produced in the IDE but also the developer’s comments and then, in real time, suggests what it predicts would be a useful next chunk of code.

Code Whisperer GIF

“CodeWhisperer is not just auto-completing a few words or a line of code,” says senior applied-science manager Parminder Bhatia, who leads the CodeWhisperer science team. “It can generate 15, 20, 30 lines, all on the fly. And this is not code copied and pasted from elsewhere; it has been created and customized to suit the developer’s intent, incorporating coding best practices.”

When CodeWhisperer was first made available for preview, it offered code recommendations in Python, Java, and JavaScript. Today at Amazon’s re:Invent conference, the team announced that the C# and TypeScript programming languages had been added.

Related content
Amazon DynamoDB was introduced 10 years ago today; one of its key contributors reflects on its origins, and discusses the 'never-ending journey' to make DynamoDB more secure, more available and more performant.

“Innovation occurs when developers spend time on novel and creative work,” says Bing Xiang, director of applied science at the AI Labs of Amazon Web Services. “Generative AI like CodeWhisperer can easily handle the undifferentiated coding and reserve human interaction for high-judgement situations.”

This sort of assistance has only just become possible, Bhatia adds. “AI has accelerated in the last five years to the point at which these large models can understand and reason sufficiently to provide contextualized recommendations.” And the more code and notes a developer produces, Bhatia explains, the better CodeWhisperer understands the intention of that code, so its suggestions become better tailored and more nuanced.

What is Amazon CodeWhisperer?
Introducing Amazon CodeWhisperer, a machine learning (ML)-powered service that helps improve developer productivity by providing code recommendations based on developers’ natural comments and prior code.

Trustworthy code

The downside of using public datasets to train AI models like CW, of course, is that they can reflect undesirable aspects of the wider world, including imperfect security, toxicity, and unfairness or bias toward specific groups; they can also reveal personal identifiable information.

“At Amazon CodeWhisperer, we take such concerns seriously,” says Ramesh Nallapati, senior principal scientist at AWS AI Labs. “We design our system to help remove security vulnerabilities in a developer’s entire project. We also address the toxicity and fairness of the generated code by evaluating it in real time and taking necessary steps to reduce exposure to the user from such content.

"In addition to toxicity and bias filtering, CodeWhisperer's reference tracker feature can also identify instances where code generations may be similar to particular training data. The developer can then inspect the reference repository and make a decision whether or not to use the code, including whether to take a dependency or license from the reference repository."

Related content
With an encoder-decoder architecture — rather than decoder only — the Alexa Teacher Model excels other large language models on few-shot tasks such as summarization and machine translation.

One of the other challenges the team faced in developing the system involves both sustainability and speed. For CodeWhisperer to be any use to developers, its suggestions need to appear in a split second. A good idea arriving 20 seconds too late would be a distraction, not a help. The challenge is that running large models requires serious computational resources — not ideal when time is of the essence.

“We deal with the latency problem by leveraging a variety of techniques, including model quantization and memory access reduction techniques developed in-house, which allow for multiple recommendations without incurring extra latency cost,” says Xiang. “These efficiencies also boost the sustainability of the tool.”

CodeWhisperer is just one of a raft of projects with generative AI and large language models at their heart that Xiang’s extensive science team is working on. Their topics range from search and recommendations to question answering and information extraction.

Multilinguality

With the aim of supporting the wider machine learning (ML) community in developing code-generating models, Xiang’s team has developed a benchmarking tool supporting the evaluation of code generation abilities in 10+ programming languages. To achieve this, the team developed a novel transpiler — a programming-language conversion tool — that automatically converts the input texts and test cases of a popular Python benchmarking dataset (Most Basic Programming Problems, or MBPP) into their multi-lingual counterparts. They describe the resulting collection of benchmarking datasets, which they call MBXP, in a paper that is currently under conference submission but available as a preprint on arXiv.

Code translation.png
The code generation model described in the new AWS paper can use the style and content of a reference solution to generate a correct solution in a different language.

The tool can be used not only to evaluate the quality of generated code in a variety of programming languages but also to explore the broader aspects of code-producing language models. For example, it can be used to probe the question of how well large language models can generalize to other programming languages on which they have not been specifically trained (spoiler alert: surprisingly well, in some cases).

“Multilingual evaluation also enables us to discover intriguing capabilities of language models, such as their zero-shot translation abilities, where a model can use a reference code in language A to help write code in language B more accurately,” says Ben Athiwaratkun, an ML scientist at Amazon and first author on the paper. “MBXP allows us to investigate other aspects of code generation models, such as robustness to input, code insertion abilities, or the effects of few-shot samples on reducing syntax errors, all in a multilingual fashion.”

Related content
MASSIVE dataset and Massively Multilingual NLU (MMNLU-22) competition and workshop will help researchers scale natural-language-understanding technology to every language on Earth.

By publicly releasing this multilingual code evaluation benchmark, the team hopes to accelerate research in this nascent field. “And because the language conversion is automated,” Athiwaratkun says, “we can easily expand the benchmark to include new programming languages in the future, without the need for an extensive annotation loop.”

The CodeWhisperer product and these research-focused innovations are just the beginning of what ML can do for software developers, Bhatia explains. “Just as large language models can reliably translate spoken languages, we can expect the same to follow for translating between programming languages,” he says. “Today, not only can CodeWhisperer produce code on the basis of natural-language comments, but it is also making inroads toward summarizing in natural language what a given piece of code is intended to do.”

What this is heading toward, in some sense, is the democratization and demystification of coding. Ultimately, the power of coding will not reside solely in the capacity of an individual or group to painstakingly piece code together.

Consider the proliferation of generative-AI art. Now, anyone with an imagination can create incredible artworks with just a few prompt words expressing an artistic intention. The automation of coding hasn’t advanced as far, but AI’s increasingly high-level comprehension of both coding and natural language will not only boost the professional capability of developers but also open up coding to a much wider audience. “This is a giant effort,” says Bhatia. “This is a paradigm shift.”

Research areas

Related content

US, WA, Bellevue
Conversational AI ModEling and Learning (CAMEL) team is part of Amazon Devices organization where our mission is to build a best-in-class Conversational AI that is intuitive, intelligent, and responsive, by developing superior Large Language Models (LLM) solutions and services which increase the capabilities built into the model and which enable utilizing thousands of APIs and external knowledge sources to provide the best experience for each request across millions of customers and endpoints. We are looking for a passionate, talented, and resourceful Applied Scientist in the field of LLM, Artificial Intelligence (AI), Natural Language Processing (NLP), Recommender Systems and/or Information Retrieval, to invent and build scalable solutions for a state-of-the-art context-aware conversational AI. A successful candidate will have strong machine learning background and a desire to push the envelope in one or more of the above areas. The ideal candidate would also have hands-on experiences in building Generative AI solutions with LLMs, enjoy operating in dynamic environments, be self-motivated to take on challenging problems to deliver big customer impact, moving fast to ship solutions and then iterating on user feedback and interactions. Key job responsibilities As an Applied Scientist, you will leverage your technical expertise and experience to collaborate with other talented applied scientists and engineers to research and develop novel algorithms and modeling techniques to reduce friction and enable natural and contextual conversations. You will analyze, understand and improve user experiences by leveraging Amazon’s heterogeneous data sources and large-scale computing resources to accelerate advances in artificial intelligence. You will work on core LLM technologies, including Prompt Engineering and Optimization, Supervised Fine-Tuning, Learning from Human Feedback, Evaluation, Self-Learning, etc. Your work will directly impact our customers in the form of novel products and services.
IL, Tel Aviv
Are you an inventive, curious, and driven Applied Scientist with a strong background in AI and Deep Learning? Join Amazon’s AWS Multimodal generative AI science team and be a catalyst for groundbreaking advancements in Computer Vision, Generative AI, and foundational models. As part of the AWS Multimodal generative AI science team, you’ll lead innovative research projects, develop state-of-the-art algorithms, and pioneer solutions that will directly impact millions of Amazon customers. Leveraging Amazon’s vast computing power, you’ll work alongside a supportive and diverse group of top-tier scientists and engineers, contributing to products that redefine the industry. Key job responsibilities * Lead research initiatives in Multimodal generative AI, pushing the boundaries of model efficiency, accuracy, and scalability. * Design, implement, and evaluate deep learning models in a production environment. * Collaborate with cross-functional teams to transfer research outcomes into scalable AWS services. * Publish in top-tier conferences and journals, keeping Amazon at the forefront of innovation. * Mentor and guide other scientists and engineers, fostering a culture of scientific curiosity and excellence.
GB, Cambridge
The Artificial General Intelligence team (AGI) has an exciting position for an Applied Scientist with a strong background NLP and Large Language Models to help us develop state-of-the-art conversational systems. As part of this team, you will collaborate with talented scientists and software engineers to enable conversational assistants capabilities to support the use of external tools and sources of information, and develop novel reasoning capabilities to revolutionise the user experience for millions of Alexa customers. Key job responsibilities As an Applied Scientist, you will develop innovative solutions to complex problems to extend the functionalities of conversational assistants . You will use your technical expertise to research and implement novel algorithms and modelling solutions in collaboration with other scientists and engineers. You will analyse customer behaviours and define metrics to enable the identification of actionable insights and measure improvements in customer experience. You will communicate results and insights to both technical and non-technical audiences through written reports, presentations and external publications.
US, WA, Bellevue
Conversational AI ModEling and Learning (CAMEL) team is part of Amazon Artificial General Intelligence (AGI) organization where our mission is to create a best-in-class Conversational AI that is intuitive, intelligent, and responsive, by developing superior Large Language Models (LLM) solutions and services which increase the capabilities built into the model and which enable utilizing thousands of APIs and external knowledge sources to provide the best experience for each request across millions of customers and endpoints. We are looking for a passionate, talented, and resourceful Applied Scientist in the field of LLM, Artificial Intelligence (AI), Natural Language Processing (NLP), Recommender Systems and/or Information Retrieval, to invent and build scalable solutions for a state-of-the-art context-aware conversational AI. A successful candidate will have strong machine learning background and a desire to push the envelope in one or more of the above areas. The ideal candidate would also have hands-on experiences in building Generative AI solutions with LLMs, enjoy operating in dynamic environments, be self-motivated to take on challenging problems to deliver big customer impact, moving fast to ship solutions and then iterating on user feedback and interactions. Key job responsibilities As an Applied Scientist, you will leverage your technical expertise and experience to collaborate with other talented applied scientists and engineers to research and develop novel algorithms and modeling techniques to reduce friction and enable natural and contextual conversations. You will analyze, understand and improve user experiences by leveraging Amazon’s heterogeneous data sources and large-scale computing resources to accelerate advances in artificial intelligence. You will work on core LLM technologies, including Supervised Fine-Tuning (SFT), In-Context Learning (ICL), Learning from Human Feedback (LHF), etc. Your work will directly impact our customers in the form of novel products and services.
US, WA, Seattle
We are seeking a highly skilled economist to measure and understand how each Customer Service activity impacts customers. This candidate's analysis will assist teams across Amazon to prioritize defect elimination efforts and optimize how we respond to customer contacts. This candidate will partner closely with our product, program, and tech teams to deliver their findings to users via systems and dashboards that guide Customer Service planning and policy rules. Key job responsibilities - Develop Causal, Economic, and Machine Learning models at scale. - Engage in economic analysis and raise the bar for research. - Inform strategic discussions with senior leaders across the company to guide policies. A day in the life If you are not sure that every qualification on the list above describes you exactly, we'd still love to hear from you! At Amazon, we value people with unique backgrounds, experiences, and skillsets. If you’re passionate about this role and want to make an impact on a global scale, please apply! Amazon offers a full range of benefits that support you and eligible family members, including domestic partners and their children. Benefits can vary by location, the number of regularly scheduled hours you work, length of employment, and job status such as seasonal or temporary employment. The benefits that generally apply to regular, full-time employees include: 1. Medical, Dental, and Vision Coverage 2. Maternity and Parental Leave Options 3. Paid Time Off (PTO) 4. 401(k) Plan About the team The Worldwide defect elimination team's mission is to understand and resolve all issues impacting customers at scale. The Customer Service Economics and Optimization team is a force multiplier within this group, helping to understand the impact of these issues and our actions to optimize the customer experience.
US, WA, Seattle
We are building GenAI based shopping assistant for Amazon. We reimage Amazon Search with an interactive conversational experience that helps you find answers to product questions, perform product comparisons, receive personalized product suggestions, and so much more, to easily find the perfect product for your needs. We’re looking for the best and brightest across Amazon to help us realize and deliver this vision to our customers right away. This will be a once in a generation transformation for Search, just like the Mosaic browser made the Internet easier to engage with three decades ago. If you missed the 90s—WWW, Mosaic, and the founding of Amazon and Google—you don’t want to miss this opportunity.
US, WA, Seattle
At Amazon, we believe that scientific innovation is essential to being the most customer-centric company in the world. Our scientists' ability to have an impact at scale allows us to attract some of the brightest minds in machine learning, artificial intelligence and related fields. Amazon scientists employ the company's working backwards method to identify problems to solve on behalf of customers in research areas ranging from machine learning to operations, GenAI, robotics, quantum computing, computer vision, economics, search, sustainability and more. Learn more about Amazon Science here: https://www.amazon.science/ We are hiring across multiple businesses and in many locations across the US. Apply here to learn more about open roles that could be a compelling fit for your background. Key job responsibilities You will be responsible for defining key research directions, adopting or inventing new machine learning techniques, conducting rigorous experiments, publishing results, and ensuring that research is translated into practice. You will develop long-term strategies, persuade teams to adopt those strategies, propose goals and deliver on them. You will also participate in organizational planning, hiring, mentorship and leadership development. You will be technically fearless and with a passion for building scalable science and engineering solutions. You will serve as a key scientific resource in full-cycle development (conception, design, implementation, testing to documentation, delivery, and maintenance).
NL, Amsterdam
Are you a MS or PhD student interested in a 2025 Internship in the field of machine learning, deep learning, speech, robotics, computer vision, optimization, quantum computing, automated reasoning, or formal methods? If so, we want to hear from you! We are looking for students interested in using a variety of domain expertise to invent, design and implement state-of-the-art solutions for never-before-solved problems. You can find more information about the Amazon Science community as well as our interview process via the links below; https://www.amazon.science/ https://amazon.jobs/content/en/career-programs/university/science https://amazon.jobs/content/en/how-we-hire/university-roles/applied-science Key job responsibilities As an Applied Science Intern, you will own the design and development of end-to-end systems. You’ll have the opportunity to write technical white papers, create roadmaps and drive production level projects that will support Amazon Science. You will work closely with Amazon scientists, and other science interns to develop solutions and deploy them into production. You will have the opportunity to design new algorithms, models, or other technical solutions whilst experiencing Amazon’s customer focused culture. The ideal intern must have the ability to work with diverse groups of people and cross-functional teams to solve complex business problems. A day in the life At Amazon, you will grow into the high impact, visionary person you know you’re ready to be. Every day will be filled with developing new skills and achieving personal growth. How often can you say that your work changes the world? At Amazon, you’ll say it often. Join us and define tomorrow. Some more benefits of an Amazon Science internship include; • All of our internships offer a competitive stipend/salary • Interns are paired with an experienced manager and mentor(s) • Interns receive invitations to different events such as intern program initiatives or site events • Interns can build their professional and personal network with other Amazon Scientists • Interns can potentially publish work at top tier conferences each year About the team Applicants will be reviewed on a rolling basis and are assigned to teams aligned with their research interests and experience prior to interviews. Start dates are available throughout the year and durations can vary in length from 3-6 months for full time internships. This role may available across multiple locations in the EMEA region (Austria, Estonia, France, Germany, Ireland, Israel, Italy, Luxembourg, Netherlands, Poland, Romania, Spain, UAE, and UK). Please note these are not remote internships.
US, WA, Seattle
Come be a part of a rapidly expanding $35 billion-dollar global business. At Amazon Business, a fast-growing startup passionate about building solutions, we set out every day to innovate and disrupt the status quo. We stand at the intersection of tech & retail in the B2B space developing innovative purchasing and procurement solutions to help businesses and organizations thrive. At Amazon Business, we strive to be the most recognized and preferred strategic partner for smart business buying. Bring your insight, imagination and a healthy disregard for the impossible. Join us in building and celebrating the value of Amazon Business to buyers and sellers of all sizes and industries. Unlock your career potential. The AB Sales Analytics, Data, Product and Tech (ADAPTech) team uses CRM, data, product, and science to improve Sales productivity and performance. It has four pillars: 1) SalesTech maintains Salesforce to enable Sales workflows, and supports >2K users in nine countries; 2) Product and Science builds tools embedded with bespoke Machine Learning (ML) and GenAI large language models to enable sales reps to prioritize top accounts, position the right Amazon Business (AB) product features, and take actions based on critical customer events; 3) Sales Data Management (SDM) and Sales Account Management (SAM) enrich customer profiles and business hierarchies while improving productivity through automation and integration of internal/external tools; and 4) Business Intelligence (BI) enables self-service reporting simplifying access to key insights through WBRs and dashboards. Sales teams leverage these products to identify which customers to target, what features to target them with, and when to target them, in order to capture their share of wallet. A successful Applied Scientist at Amazon demonstrates bias for action and operates in a startup environment, with outstanding leadership skills, and proven ability to build and manage medium-scale modeling projects, identify data requirements, build methodology and tools that are statistically grounded. We need great leaders to think big and design new solutions to solve complex problems using machine learning (ML) and Generative AI techniques to improve our customers’ experience when using AB. You have hands-on experience making the right decisions about technology, models and methodology choices. Key job responsibilities As an Applied Scientist, you will primarily leverage machine learning techniques and generative AI to outreach customers based on their life cycle stage, behavioral patterns, and purchase history. You may also perform text mining and insight analysis of real-time customer conversations and make the model learn and recommend the solutions. Your work will directly impact the trust customers place in Amazon Business. You will partner with product management and technical leadership to identify opportunities to innovate customer journey experiences. You will identify new areas of investment and work to align product roadmaps to deliver on these opportunities. As a science leader, you will not only develop unique scientific solutions, but also play a crucial role in shaping strategies. Additional responsibilities include: -Design, implement, test, deploy and maintain innovative data and machine learning solutions to further the customer experience. -Create experiments and prototype implementations of new learning algorithms and prediction techniques -Develop algorithms for new capabilities and trace decisions in the data and assess how proposed changes could potentially impact business metrics to cater needs of Amazon Business Sales -Build models that measure incremental value, predict growth, define and conduct experiments to optimize engagement of AB customers, and communicate insights and recommendations to product, sales, and finance partners. A day in the life In this role, you will be a technical expert with significant scope and impact. You will work with Technical Product Managers, Data Engineers, other Scientists, and Salesforce developers, to build new and enhance existing ML models to optimize customer experience. You will prototype and test new ideas, iterate quickly, and deploy models to production. Also, you will conduct in-depth data analysis and feature engineering to build robust ML models.
US, WA, Seattle
Amazon continues to invest heavily in building our world class advertising business. Our products are strategically important to our Retail and Marketplace businesses, driving long term growth. We deliver billions of ad impressions and millions of clicks daily, breaking fresh ground to create world-class products. We are highly motivated, collaborative and fun-loving with an entrepreneurial spirit and strong bias for action. With a broad mandate to experiment and innovate, we are growing at an unprecedented rate with a seemingly endless range of new opportunities. The Sponsored Products Monetization team is broadly responsible for pricing of ads on Amazon search pages, balancing short-term and long-term ad revenue growth to drive sustainable marketplace health. As a Senior Applied Scientist on our team, you will be responsible for defining the science and technical strategy for one of our most impactful marketplace controls, creating lasting value for Amazon and our advertising customers. You will help to identify unique opportunities to create customized and delightful shopping experience for our growing marketplaces worldwide. Your job will be identify big opportunities for the team that can help to grow Sponsored Products business working with retail partner teams, Product managers, Software engineers and PMs. You will have opportunity to design, run and analyze A/B experiments to improve the experience of millions of Amazon shoppers while driving quantifiable revenue impact. More importantly, you will have the opportunity to broaden your technical skills in an environment that thrives on creativity, experimentation, and product innovation. Key job responsibilities - Lead science, tech and business strategy and roadmap for Sponsored Products Monetization - Drive alignment across multiple organizations for science, engineering and product strategy to achieve business goals - Lead and mentor scientists and engineers across teams to develop, test, launch and improve of science models designed to optimize the shopper experience and deliver long term value for Amazon and advertisers - Develop state of the art experimental approaches and ML models - Drive end-to-end Machine Learning projects that have a high degree of ambiguity, scale, complexity - Establish scalable, efficient, automated processes for large-scale data analysis, machine-learning model development, model validation and serving - Research new and innovative machine learning approaches - Recruit Scientists to the team and provide mentorship