How Alexa knows “peanut butter” is one shopping-list item, not two

At a recent press event on Alexa's latest features, Alexa’s head scientist, Rohit Prasad, mentioned multistep requests in one shot, a capability that allows you to ask Alexa to do multiple things at once. For example, you might say, “Alexa, add bananas, peanut butter, and paper towels to my shopping list.” Alexa should intelligently figure out that “peanut butter” and “paper towels” name two items, not four, and that bananas are a separate item.

Typical spoken-language understanding (SLU) systems map user utterances to intents (actions) and slots (entity names). For example, the utterance “What is the weather like in Boston?” has one intent, WeatherInfo, and one slot type, CityName, whose value is “Boston.” This is an example of a “narrow parse”.

Narrow parsers usually have rigid constraints, such as allowing only one intent to be associated with an utterance and only one value to be associated with a slot type. In a paper that we’re presenting at this year’s IEEE Spoken Language Technology conference (SLT 2018), we discuss a way to enable SLU systems to understand compound entities and intents.

We augment an SLU system with a domain-agnostic parser that can identify syntactic elements that establish relationships between different parts of an utterance, or “coordination structures”. In tests comparing our system to an off-the-shelf broad syntactic parser, we show a 26% increase in accuracy.

Off-the-shelf broad parsers are intended to detect coordination structures, but they are often trained on written text with correct punctuation. Automatic speech recognition (ASR) outputs, by contrast, often lack punctuation, and spoken language has different syntactic patterns than written language.

Our new parser is a deep neural network that we train on varied coordination structures in spoken-language data. The training examples are labeled according to the BIO scheme, which indicates groups of words — or “chunks” — that should be treated as ensembles. Most of the words in a sample utterance are labeled with either a B, to indicate the beginning of a chunk, an I, to indicate the inside of a chunk, or an O, to indicate a word that lies outside a chunk. Coordinating conjunctions such as “and” are labeled independently.

BIO_scheme_examples.png._CB459952676_.png
Sample utterances, labeled according to the BIO scheme

Inputs to the network undergo embedding, a process that represents words as points (vectors) in high-dimensional spaces. We experiment with two different types of embeddings: word embeddings, in which words with similar functions are clustered together, and character embeddings, in which words that contain the same subsequences of letters are clustered together. Character embeddings are useful for systems like ours that are intended to generalize across contexts, because they enable educated guesses about the meanings of unfamiliar words on the basis of their roots, prefixes, and suffixes.

The embeddings then pass through a bidirectional long short-term memory. Long short-term memories (LSTMs) are networks that process sequential data in order, and any given output factors in the outputs that precede it. Bidirectional LSTMs run through a given data sequence both forward and backward.

The output of the bi-LSTM is a contextual embedding of each word in the input sentence, which captures information about its position in the sentence. On top of the bi-LSTM layer, we have a dense layer to map each contextual word embedding to a distribution over the output labels, which are the B, I, and O of the BIO scheme.

In our experiments, we evaluated a system that classifies each word of the input according to its most probable output label. But we got better results by passing the label estimates through a conditional-random-field (CRF) layer. The CRF layer learns associations between output labels and chooses the most likely sequence of output labels from all possible sequences.

When we relied directly on the output of the label-prediction layer, it was possible to get incoherent outputs — such as an O tag followed by an I tag — since each label is independently predicted. The CRF layer, however, would learn that such a sequence of output labels is unlikely and assign it a low score.

Instead of building separate parsers for different slot types (such as ListItem, FoodItem, Appliance, etc.), we built one parser that can handle multiple slot types. For example, our parser can successfully identify ListItems in the utterance “add apples peanut butter and jelly to my list” and Appliances in the utterance “turn on the living room light and kitchen light”.

To enable our model to generalize, we used a technique called adversarial training. During training, the output of the bi-LSTM layer passes not only to the densely connected layer that learns to predict BIO labels but to another layer that learns to predict domains, or broad topic categories such as Weather, Music, and Groceries. The network is evaluated not only on how well it predicts BIO labels but on how badly it predicts domain labels. That way, we ensure that it learns chunking cues that are not domain-specific.

To generate data for our experiments, we take annotated single-entity data and replace the single entities with two or more entities of the same slot type with coordinating conjunctions between the penultimate entity and the final entity. For example, the utterance “set the timer for five minutes” might become “set the timer for five and ten minutes”.

We ran an extensive set of experiments with variations in how the word embeddings are initialized (randomly or with pretrained embeddings, such as FastText, that group words together by meaning), whether or not we use character embeddings, and whether or not we use the CRF layer at the top. We tested separately on two-entity, three-entity, and four-or-more-entity utterances and measured accuracy.

We noticed a few general trends: irrespective of the model configuration, accuracy degrades as we move from two- to three- to four-or-more-entity utterances; initialization with pretrained embeddings usually helps; and adding a CRF layer almost always improves accuracy. Our best results — the ones that improved most on the off-the-shelf parser — came from a model that used character embeddings, pretrained FastText embeddings, and a CRF layer.

Acknowledgments: Rahul Goel, Tagyoung Chung, Abhishek Sethi, Arindam Mandal, Spyros Matsoukas

Related content

IL, Haifa
AWS Utility Computing (UC) provides product innovations — from foundational services such as Amazon’s Simple Storage Service (S3) and Amazon Elastic Compute Cloud (EC2), to consistently released new product innovations that continue to set AWS’s services and features apart in the industry. As a member of the UC organization, you’ll support the development and management of Compute, Database, Storage, Internet of Things (Iot), Platform, and Productivity Apps services in AWS, including support for customers who require specialized security solutions for their cloud services. 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. About the team About AWS Diverse Experiences AWS values diverse experiences. Even if you do not meet all of the preferred qualifications and skills listed in the job description, we encourage candidates to apply. If your career is just starting, hasn’t followed a traditional path, or includes alternative experiences, don’t let it stop you from applying. Why AWS? Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform. We pioneered cloud computing and never stopped innovating — that’s why customers from the most successful startups to Global 500 companies trust our robust suite of products and services to power their businesses. Inclusive Team Culture: Here at AWS, it’s in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (gender diversity) conferences, inspire us to never stop embracing our uniqueness. Mentorship & Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve.
AU, NSW, Sydney
AWS Sales, Marketing, and Global Services (SMGS) is responsible for driving revenue, adoption, and growth from the largest and fastest growing small- and mid-market accounts to enterprise-level customers including public sector. The AWS Global Support team interacts with leading companies and believes that world-class support is critical to customer success. AWS Support also partners with a global list of customers that are building mission-critical applications on top of AWS services. The Generative Artificial Intelligence (AI) Innovation Center team at AWS provides opportunities to innovate in a fast-paced organization that contributes to game-changing projects and technologies leveraging cutting-edge generative AI algorithms. As an Applied Scientist, you'll partner with technology and business teams to build solutions that surprise and delight our customers. We’re looking for Applied Scientists capable of using generative AI and other ML techniques to design, evangelize, and implement state-of-the-art solutions for never-before-solved problems. Key job responsibilities - Collaborate with scientists and engineers to research, design and develop cutting-edge generative AI algorithms to address real-world challenges - Work across customer engagement to understand what adoption patterns for generative AI are working and rapidly share them across teams and leadership - Interact with customers directly to understand the business problem, help and aid them in implementation of generative AI solutions, deliver briefing and deep dive sessions to customers and guide customer on adoption patterns and paths for generative AI - Create and deliver best practice recommendations, tutorials, blog posts, sample code, and presentations adapted to technical, business, and executive stakeholder - Provide customer and market feedback to Product and Engineering teams to help define product direction. A day in the life Here at AWS, we embrace our differences. We are committed to furthering our culture of inclusion. We have ten employee-led affinity groups, reaching 40,000 employees in over 190 chapters globally. We have innovative benefit offerings, and host annual and ongoing learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (gender diversity) conferences. Amazon’s culture of inclusion is reinforced within our 16 Leadership Principles, which remind team members to seek diverse perspectives, learn and be curious, and earn trust. About the team Diverse Experiences AWS values diverse experiences. Even if you do not meet all of the qualifications and skills listed in the job description, we encourage candidates to apply. If your career is just starting, hasn’t followed a traditional path, or includes alternative experiences, don’t let it stop you from applying. Why AWS? Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform. We pioneered cloud computing and never stopped innovating — that’s why customers from the most successful startups to Global 500 companies trust our robust suite of products and services to power their businesses. Inclusive Team Culture Here at AWS, it’s in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (gender diversity) conferences, inspire us to never stop embracing our uniqueness. Mentorship & Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve in the cloud. What if I don’t meet all the requirements? That’s okay! We hire people who have a passion for learning and are curious. You will be supported in your career development here at AWS. You will have plenty of opportunities to build your technical, leadership, business and consulting skills. Your onboarding will set you up for success, including a combination of formal and informal training. You’ll also have a chance to gain AWS certifications and access mentorship programs. You will learn from and collaborate with some of the brightest technical minds in the industry today.
DE, Berlin
The Community Feedback organization powers customer-generated features and insights that help customers use the wisdom of the community to make unregretted shopping decisions. Today our features include Customer Reviews, Content Moderation, and Customer Q&A (Ask), however our mission and charter are broader than these features. We are focused on building a rewarding and engaging experience for contributors to share their feedback, and providing shoppers with trusted insights based on this feedback to inform their shopping decision The Community Data & Science team is looking for a passionate, talented, and inventive Senior Applied Scientist with a background in AI, Gen AI, Machine Learning, and NLP to help build LLM solutions for Community Feedback. You'll be working with talented scientists and engineers to innovate on behalf of our customers. If you're fired up about being part of a dynamic, driven team and are ready to make a lasting impact on the future of AI-powered shopping, we invite you to join us on this exciting journey to reshape shopping. Please visit https://www.amazon.science for more information. Key job responsibilities - As a Senior Applied Scientist, you will work on state-of-the-art technologies that will result in published papers. - However, you will not only theorize about the algorithms but also have the opportunity to implement them and see how they perform in the field. - Our team works on a variety of projects, including state-of-the-art generative AI, LLM fine-tuning, alignment, prompt engineering, and benchmarking solutions. - You will be also mentoring junior scientists on the team. About the team The Community Data & Science team focusses on analyzing, understanding, structuring and presenting customer-generated content (in the form of ratings, text, images and videos) to help customers use the wisdom of the community to make unregretted purchase decisions. We build and own ML models that help with i) shaping the community content corpus both in terms of quantity and quality, ii) extracting insights from the content and iii) presenting the content and insights to shoppers to eventually influence purchase decisions. Today, our ML models support experiences like content solicitation, submission, moderation, ranking, and summarization.
US, CA, Sunnyvale
Amazon's AGI Web & Knowledge Services group is seeking a passionate, talented, and inventive Applied Scientist to lead the development of industry-leading Information retrieval systems. As part of our cutting-edge AGI-IR team, you will play a pivotal role in developing efficient AI solutions for a multi-modal future at scale. In this role, you will work alongside renowned researchers and engineers to enable our customers to seamlessly interact with unstructured and semi-structured content through advanced capabilities like question answering, contextual search, and multi-turn dialogues. Your work will directly impact our customers in the form of products and services that make use of various machine learning, deep learning and language model technologies. Key job responsibilities As an Applied Scientist, you will leverage your technical expertise and experience to demonstrate leadership in tackling large complex problems, setting the direction and collaborating with applied scientists and engineers to develop novel algorithms and modeling techniques to enable timely, relevant and delightful conversations. - Leverage Amazon's large-scale data and computing resources to accelerate advances in the state of the art. - Work backwards from customer needs and use that information to make trade-offs between different modeling approaches - Collaborate with software engineering teams to integrate successful experimental results into complex Amazon production systems - Report results to technical and business audiences in a manner that is statistically rigorous and compellingly relevant, exemplifying good scientific practice in a business environment - Drive best practices, helping to set high scientific and engineering standards on the team - Promote the culture of experimentation and applied science at Amazon
US, WA, Seattle
AWS Industry Products (IP) is a new AWS engineering organization chartered to build new AWS products by applying Amazon’s innovation mechanisms along with AWS digital technologies to transform the world, industry by industry. We dive deep with leaders and innovators to solve the problems which block their industries, enabling them to capitalize on new digital business models. Simply put, our goal is to use the skill and scale of AWS to make the benefits of a connected world achievable for all businesses. We are looking for an Applied Scientist who are passionate about transforming industries through AI. This is a unique opportunity to not only listen to industry customers but also to develop AI and generative AI expertise in multiple core industries. You will join a team of scientists, product managers and software engineers that builds AI solutions in automotive, manufacturing, healthcare, sustainability/clean energy, and supply chain/operations domains. Leveraging and advancing generative AI technology will be a big part of your charter as we seek to apply the latest advancements in generative AI to industry-specific problems. Key job responsibilities Using your in-depth expertise in machine learning and generative AI, you will deliver reusable science components and services that differentiate our industry products and solve customer problems. You will be the voice of scientific rigor, delivery, and innovation as you work with our segment teams on AI-driven product differentiators. You will conduct and advance research in AI and generative AI within and outside Amazon.
US, MA, North Reading
Are you inspired by invention? Is problem solving through teamwork in your DNA? Do you like the idea of seeing how your work impacts the bigger picture? Answer yes to any of these and you’ll fit right in here at Amazon Robotics. We are a smart team of doers who work passionately to apply cutting edge advances in robotics and software to solve real-world challenges that will transform our customers’ experiences. We invent new improvements every day. We are Amazon Robotics and we will give you the tools and support you need to invent with us in ways that are rewarding, fulfilling, and fun. Amazon Robotics is seeking students to join us for a 5-6 month internship (full-time, 40 hours per week) as Data Science Co-op. Please note that by applying to this role you would be considered for Data Scientist spring co-op and fall co-op roles on various Amazon Robotics teams. The internship/co-op project(s) and location are determined by the team the student will be working on. Learn more about Amazon Robotics: https://amazon.jobs/en/teams/amazon-robotics About the team Amazon empowers a smarter, faster, more consistent customer experience through automation. Amazon Robotics automates fulfillment center operations using various methods of robotic technology including autonomous mobile robots, sophisticated control software, language perception, power management, computer vision, depth sensing, machine learning, object recognition, and semantic understanding of commands. Amazon Robotics has a dedicated focus on research and development to continuously explore new opportunities to extend its product lines into new areas.
US, WA, Seattle
Ever wonder how you can keep the world’s largest selection also the world’s safest and legally compliant selection? Then come join a team with the charter to monitor and classify the billions of items in the Amazon catalog to ensure compliance with various legal regulations. The Classification and Policy Platform (CPP) team is looking for Applied Scientists to build technology to automatically monitor the billions of products on the Amazon platform. The software and processes built by this team are a critical component of building a catalog that our customers trust. As an Applied Scientist on the CPP team, you will train LLMs to solve customer problems, distill knowledge into optimized inference artifacts, and collaborate cross-functionally to deliver impactful solutions. This role offers the opportunity to push the boundaries of LLM capabilities and drive tangible value for our customers. The ideal candidate should possess exceptional technical skills, a startup-driven mindset, outstanding communication abilities to join our dynamic team. We believe that innovation is key to being the most customer-centric company. We innovate, publish, teach, and set strategy, while using Amazon's "working backwards" method to serve our customers.
US, MA, Boston
As part of Alexa CAS team, our mission is to provide scalable and reliable evaluation of the state-of-the-art Conversational AI. We are looking for a passionate, talented, and resourceful Applied Scientist in the field of LLM, Artificial Intelligence (AI), Natural Language Processing (NLP), to invent and build end-to-end evaluation of how customers perceive state-of-the-art context-aware conversational AI assistants. 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, including Supervised Fine-Tuning (SFT), In-Context Learning (ICL), Learning from Human Feedback (LHF), etc. 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 methods for evaluating conversational assistants. You will analyze and understand user experiences by leveraging Amazon’s heterogeneous data sources and build evaluation models using machine learning methods. Key job responsibilities - Design, build, test and release predictive ML models using LLMs - Ensure data quality throughout all stages of acquisition and processing, including such areas as data sourcing/collection, ground truth generation, normalization, and transformation. - Collaborate with colleagues from science, engineering and business backgrounds. - Present proposals and results to partner teams in a clear manner backed by data and coupled with actionable conclusions - Work with engineers to develop efficient data querying and inference infrastructure for both offline and online use cases About the team Central Analytics and Research Science (CARS) is an analytics, software, and science team within Amazon's Conversational Assistant Services (CAS) organization. Our mission is to provide an end-to-end understanding of how customers perceive the assistants they interact with – from the metrics themselves to software applications to deep dive on those metrics – allowing assistant developers to improve their services. Learn more about Amazon’s approach to customer-obsessed science on the Amazon Science website, which features the latest news and research from scientists across the company. For the latest updates, subscribe to the monthly newsletter, and follow the @AmazonScience handle and #AmazonScience hashtag on LinkedIn, Twitter, Facebook, Instagram, and YouTube.
US, WA, Seattle
Amazon Advertising is one of Amazon's fastest growing and most profitable businesses. As a core product offering within our advertising portfolio, Sponsored Products (SP) helps merchants, retail vendors, and brand owners succeed via native advertising, which grows incremental sales of their products sold through Amazon. The SP team's primary goals are to help shoppers discover new products they love, be the most efficient way for advertisers to meet their business objectives, and build a sustainable business that continuously innovates on behalf of customers. Our products and solutions are strategically important to enable our Retail and Marketplace businesses to drive long-term growth. We deliver billions of ad impressions and millions of clicks and break fresh ground in product and technical innovations every day! Within Sponsored Products, the Bidding team is responsible for defining and delivering a collection of advertising products around bid controls (dynamic bidding, bid recommendations, etc.) that drive discovery and sales. Our solutions generate billions in revenue and drive long-term growth for Amazon’s Retail and Marketplace businesses. We deliver billions of ad impressions, millions of clicks daily, and break fresh ground to create world-class products. We are highly motivated, collaborative, and fun-loving team with an entrepreneurial spirit - with a broad mandate to experiment and innovate. You will invent new experiences and influence customer-facing shopping experiences to help suppliers grow their retail business and the auction dynamics that leverage native advertising; this is your opportunity to work within the fastest-growing businesses across all of Amazon! Define a long-term science vision for our advertising business, driven fundamentally from our customers' needs, translating that direction into specific plans for research and applied scientists, as well as engineering and product teams. This role combines science leadership, organizational ability, technical strength, product focus, and business understanding.
US, WA, Seattle
Amazon Advertising is one of Amazon's fastest growing and most profitable businesses, responsible for defining and delivering a collection of advertising products that drive discovery and sales. Our products and solutions are strategically important to enable our Retail and Marketplace businesses to drive long-term growth. We deliver billions of ad impressions and millions of clicks and break fresh ground in product and technical innovations every day! Are you interested in working with the core Amazon Advertising teams and leading ad tech partners to spearhead innovation and deliver Identity solutions for our customers? Do you want to have direct and immediate impact on millions of customers every day? We are building the next generation of Identity products and services that will fuel the growth of Amazon’s advertising business. We are looking for self-driven and talented engineers to revel in designing, developing and operating extremely high volume (internet-scale), low latency systems that drive revenue to Amazon. This role will involve designing and developing software system that enable many use cases for WW Advertising. The individual in this role will have the responsibility help define requirements, create software design, implement code to these specifications, provide thorough unit and integration testing, and support products deployed in production and used by our stakeholders and customers. We’re looking for experienced, motivated software engineers with a proven track record of building low-latency / high volume ad serving systems and services. Bonus if you are also comfortable handling big data queries and analytics - that is an integral part of what we do. We use Java and AWS technologies heavily. Why you will love this opportunity: Amazon is investing heavily in building a world-class advertising business. This team defines and delivers a collection of advertising products that drive discovery and sales. Our solutions generate billions in revenue and drive long-term growth for Amazon’s Retail and Marketplace businesses. We deliver billions of ad impressions, millions of clicks daily, and break fresh ground to create world-class products. We are a highly motivated, collaborative, and fun-loving team with an entrepreneurial spirit - with a broad mandate to experiment and innovate. Impact and Career Growth: You will invent new experiences and influence customer-facing shopping experiences to help suppliers grow their retail business and the auction dynamics that leverage native advertising; this is your opportunity to work within the fastest-growing businesses across all of Amazon! Define a long-term science vision for our advertising business, driven from our customers' needs, translating that direction into specific plans for research and applied scientists, as well as engineering and product teams. This role combines science leadership, organizational ability, technical strength, product focus, and business understanding. Team video https://youtu.be/zD_6Lzw8raE Key job responsibilities As an Applied Scientist on this team, you will: - Drive end-to-end Machine Learning projects that have a high degree of ambiguity, scale, complexity. - Perform hands-on analysis and modeling of enormous data sets to develop insights that increase traffic monetization and merchandise sales, without compromising the shopper experience. - Build machine learning models, perform proof-of-concept, experiment, optimize, and deploy your models into production; work closely with software engineers to assist in productionizing your ML models. - Run A/B experiments, gather data, and perform statistical analysis. - 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 Applied Scientists to the team and provide mentorship. A day in the life You will work collaboratively both within and outside of the Advertising team. As a Software Engineer, you would spend most of your time architecting, designing and coding and the rest in collaboration and discussion. Since we are now working remotely, we also like to have fun by taking time to celebrate each other and to spend time with happy hours. About the team Joining this team, you’ll experience the benefits of working in a dynamic, fast-paced environment, while leveraging the resources of Amazon.com (AMZN), one of the world's leading Internet companies. We provide a highly customer-centric, team-oriented environment. AdTech Identity Program (AIP) team is spearheading innovation for the existential challenge in AdTech today: The need for reliably establishing customer identity in a IDless world without 3P cookies or Device identifiers.