{"id":31641,"date":"2019-11-29T09:06:08","date_gmt":"2019-11-29T14:06:08","guid":{"rendered":"https:\/\/www.kaspersky.com\/blog\/?post_type=emagazine&#038;p=31641"},"modified":"2022-04-11T07:55:04","modified_gmt":"2022-04-11T11:55:04","slug":"natural-language-processing","status":"publish","type":"emagazine","link":"https:\/\/www.kaspersky.com\/blog\/secure-futures-magazine\/natural-language-processing\/31641\/","title":{"rendered":"The joy of text: How neural networks and language modeling are evolving how we write"},"content":{"rendered":"<p>News about artificial intelligence (AI) has taken the world by storm: machine learning and related technologies are used to provide medical <a href=\"https:\/\/www.nytimes.com\/2019\/03\/10\/technology\/artificial-intelligence-eye-hospital-india.html\" target=\"_blank\" rel=\"noopener nofollow\">diagnosis<\/a>, decrease <a href=\"https:\/\/www.forbes.com\/sites\/cognitiveworld\/2019\/05\/31\/exploring-the-impact-of-ai-in-the-data-center\/\" target=\"_blank\" rel=\"noopener nofollow\">business costs<\/a> and even put Nicholas Cage into <a href=\"https:\/\/www.indiewire.com\/2018\/01\/nicolas-cage-machine-learning-algorithm-deep-fakes-1201923224\/\" target=\"_blank\" rel=\"noopener nofollow\">every Hollywood movie<\/a>. However, one thing that\u2019s yet to be tackled by AI is our human language.<\/p>\n<p>But in recent years, the development of natural language processing (NLP) technologies has been swift. NLP tech is continually improving, beating academic baselines and providing better value for businesses. Already in market, we have better sentiment analysis for Voice of the Customer analytics (determining customer needs and satisfaction with current products) and chatbots for customer support or lead generation. Most of this progress relies on language modeling, a machine-learning task, but it\u2019s controversial due to its potential for malicious uses.<\/p>\n<h2>So what exactly is language modeling?<\/h2>\n<p>A language model is an algorithm that (in most cases) does one thing: fed with existing text, it predicts what you may want to type based on the previous words. One example is Gmail Smart Compose, which <a href=\"https:\/\/ai.googleblog.com\/2018\/05\/smart-compose-using-neural-networks-to.html\" target=\"_blank\" rel=\"noopener nofollow\">predicts and offers suggestions<\/a> to complete your email based on the previous emails in the conversation. To achieve this, a machine-learning model is trained on a huge body of text, such as the entire English language version of Wikipedia. By doing this, the model \u201clearns\u201d what words usually go together, the syntax and grammar of the language, and even some facts about the world. For example, if you type \u201cLondon is the capital of\u2026,\u201d a good language model will generate \u201cthe UK.\u201d This is one of the most widely used applications of machine learning: if you have a smartphone, odds are you have a language model on it to help you by generating predictive text to suggest what you may want to type next.<\/p>\n<p>Today, NLP researchers are creating better language models based on neural networks, a powerful family of machine-learning models. Some of which are specifically designed to work with sequential data, making them ideal models for dealing with text which is, in effect, \u201csequences\u201d of words. As a language model needs to keep track of the meaning of the text to successfully predict the right words to use, it can produce a numeric representation of texts based on its content. Computers can\u2019t deal with text directly, so they convert it into numbers. These representations are useful for many practical tasks, like classifying a customer support request or finding relevant mentions of your products within a huge stream of social posts.<br>\n<img decoding=\"async\" class=\"aligncenter size-large wp-image-31642\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2019\/11\/29085410\/natural-language-processing-inline-1024x683.jpg\" alt=\"natural language processing\" width=\"1024\" height=\"683\"><br>\nPhoto credit:<br>\nArt by\u00a0<a href=\"https:\/\/unsplash.com\/@_pngdesign?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener nofollow\">PNG Design<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener nofollow\">Unsplash<\/a><\/p>\n<p>But you can also apply a language model to its direct task: text generation. It turns out that large neural network-based language models can generate long coherent texts that are not only grammatically, structurally and stylistically convincing, but also demonstrate real-world knowledge.<\/p>\n<p>Here\u2019s an example of how these models work. I fed a model called GPT-2 with a prompt suggesting a customer review for an antivirus product from a fake company. The model proceeded to compose a review, highlighting the non-existent product\u2019s advantages (generated text is in italics):<\/p>\n<blockquote><p>I give five stars to Best Antivirus 2.0 by NotReallySecurity Company. <span style=\"color: #33cccc\"><em>It is fast and effective and does its job well. I recommend you all to install this application. Best Antivirus 2.0 will help you protect your computer from malware and viruses. Pros: Fast and powerful. It scans files very fast and efficiently<\/em><\/span>.<\/p>\n<cite><p><strong>Written by Transformer, transformer.huggingface.co<\/strong><\/p><\/cite><\/blockquote>\n<p>This is possible because the models are trained on diverse texts that include data on everything from scientific discoveries to <a href=\"http:\/\/www.kaspersky.com\/blog\" target=\"_blank\" rel=\"noopener nofollow\">news about cybersecurity<\/a>. This has got some people worried. What if these models could be used to generate misleading or fake news, for example, arguing against public health vaccinations or trying to persuade someone to vote for a particular political group in an election?<\/p>\n<h2>The neural network threat of misinformation<\/h2>\n<p><a href=\"https:\/\/openai.com\/\" target=\"_blank\" rel=\"noopener nofollow\">OpenAI<\/a>, a research organization, started <a href=\"https:\/\/thegradient.pub\/openai-shouldnt-release-their-full-language-model\/\" target=\"_blank\" rel=\"noopener nofollow\">a heated debate<\/a> on the responsibility of releasing large language models with its <a href=\"https:\/\/openai.com\/blog\/better-language-models\/\" target=\"_blank\" rel=\"noopener nofollow\">GPT-2 model<\/a>, which was shown to generate convincing fake articles about the discovery of unicorns in South America and the theft of nuclear materials in the US. The discussion continued with <a href=\"https:\/\/grover.allenai.org\/\" target=\"_blank\" rel=\"noopener nofollow\">GROVER<\/a>, created by <a href=\"https:\/\/allenai.org\/\" target=\"_blank\" rel=\"noopener nofollow\">Allen Institute for Artificial Intelligence<\/a>, another model that was specifically tailored to produce realistic news text. Researchers even <a href=\"https:\/\/medium.com\/ai2-blog\/counteracting-neural-disinformation-with-grover-6cf6690d463b\" target=\"_blank\" rel=\"noopener nofollow\">found<\/a> that GROVER-written propaganda articles were more convincing than those written by real people.<\/p>\n<p>Other applications followed. Neural network-based language models were applied to create human-like <a href=\"https:\/\/www.reddit.com\/r\/SubSimulatorGPT2\/comments\/btfhks\/what_is_rsubsimulatorgpt2\/\" target=\"_blank\" rel=\"noopener nofollow\">bots on Reddit<\/a>, write comments <a href=\"https:\/\/arxiv.org\/abs\/1909.11974\" target=\"_blank\" rel=\"noopener nofollow\">about news<\/a> stories, and create <a href=\"https:\/\/arxiv.org\/abs\/1907.09177\" target=\"_blank\" rel=\"noopener nofollow\">fake restaurant reviews<\/a>, the latter application was then perfected by a <a href=\"https:\/\/blog.einstein.ai\/introducing-a-conditional-transformer-language-model-for-controllable-generation\/\" target=\"_blank\" rel=\"noopener nofollow\">CTRL<\/a> model by <a href=\"https:\/\/einstein.ai\/\" target=\"_blank\" rel=\"noopener nofollow\">Salesforce Research<\/a>. <a href=\"https:\/\/arxiv.org\/abs\/1907.09177\" target=\"_blank\" rel=\"noopener nofollow\">Studies show<\/a> that people had difficulty discerning machine-generated texts from real human-produced content.<\/p>\n<h2>The business benefits of language modeling<\/h2>\n<p>Despite the risks, there are many benefits for businesses and their customers. Language models power many current applications, from speech recognition and spelling correction to <a href=\"https:\/\/www.blog.google\/products\/search\/search-language-understanding-bert\" target=\"_blank\" rel=\"noopener nofollow\">finding answers to questions<\/a> in a knowledge base, and open up many possibilities for more intelligent language processing. Imagine a chatbot that helps people solve the problems that are currently delivered by disengaged customer support agents, or an algorithm that can write descriptions for products on a marketplace based on their characteristics. The good news? Some of these technologies are already in the market, and better models mean more natural-sounding text and more frictionless customer experience. Text-generating algorithms can also be used to automate many standardized and repetitive copywriting jobs, like the <a href=\"https:\/\/www.washingtonpost.com\/pr\/wp\/2017\/09\/01\/the-washington-post-leverages-heliograf-to-cover-high-school-football\/\" target=\"_blank\" rel=\"noopener nofollow\">Heliograf<\/a> system which \u2018writes\u2019 about results of sports events and local elections for The Washington Post. Business correspondence (imagine a smarter version of <a href=\"https:\/\/www.blog.google\/products\/gmail\/subject-write-emails-faster-smart-compose-gmail\/\" target=\"_blank\" rel=\"noopener nofollow\">Gmail Smart Compose<\/a>) could improve by using a model that automatically sets up appointments and invites the right people based on its agenda. And this is just the start.<\/p>\n<p>But on the flip side, imagine an army of automated social bots spreading misinformationThey create panic around the share price of your enterprise. They spam online stores with negative reviews of your product. They overload your customer support team with plausible-looking requests, increasing costs and slowing the incident resolution time for real customers \u2013 not to mention seriously frustrating your team. These threats require better defense against <a href=\"https:\/\/www.pewresearch.org\/internet\/2018\/04\/09\/bots-in-the-twittersphere\/\" target=\"_blank\" rel=\"noopener nofollow\">automated accounts<\/a>, and timely proactive detection and response to counteract disinformation campaigns.<\/p>\n<p>Fortunately, the scientific community is already working hard to stop this. The authors of GROVER argue that better language models will build in fake text detectors: GROVER converts results into a classifier that can detect machine-generated news. Researchers from Harvard University and IBM used GPT-2 to create a <a href=\"http:\/\/gltr.io\/\" target=\"_blank\" rel=\"noopener nofollow\">visual tool<\/a> that helps people spot machine-generated text. Scientists and academics are also working on methods to find malicious social bots based <a href=\"https:\/\/www.researchgate.net\/publication\/339931673_Detection_of_Malicious_Social_Bots_A_Survey_and_a_Refined_Taxonomy\" target=\"_blank\" rel=\"noopener nofollow\">on their behavior<\/a>. Meanwhile, social media giants <a href=\"https:\/\/www.bloomberg.com\/news\/articles\/2019-05-23\/facebook-removed-2-2-billion-fake-accounts-in-first-quarter\" target=\"_blank\" rel=\"noopener nofollow\">Facebook<\/a> and <a href=\"https:\/\/www.washingtonpost.com\/technology\/2018\/07\/06\/twitter-is-sweeping-out-fake-accounts-like-never-before-putting-user-growth-risk\/\" target=\"_blank\" rel=\"noopener nofollow\">Twitter<\/a> make removing fake accounts, which can be used to spread misinformation, a top priority.<\/p>\n<p>One thing\u2019s for sure: current progress in language modeling and NLP gives researchers and businesses powerful tools to recreate the complexities of our human language, which opens up new opportunities to support customers and create written information with ease. The tech industry needs to work hard to develop effective NLP programs and, in tandem, develop technologies to detect the real words from the fake.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automated text has the potential to change how we write, delivering fast content and seamless customer service interactions \u2013 but it\u2019s not without risks.<\/p>\n","protected":false},"author":2544,"featured_media":31643,"template":"","coauthors":[3585],"class_list":{"0":"post-31641","1":"emagazine","2":"type-emagazine","3":"status-publish","4":"has-post-thumbnail","6":"emagazine-category-artificial-intelligence","7":"emagazine-category-digital-transformation","8":"emagazine-category-emerging-tech","9":"emagazine-category-opinions","10":"emagazine-tag-natural-language-processing"},"hreflang":[{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/secure-futures-magazine\/natural-language-processing\/31641\/"}],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/emagazine\/31641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/emagazine"}],"about":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/types\/emagazine"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/users\/2544"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media\/31643"}],"wp:attachment":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media?parent=31641"}],"wp:term":[{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/coauthors?post=31641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}