
Rewind: Chatting with Artificial Intelligence

By Allamraju Aparajitha
Hyderabad: The release of ChatGPT has led to a sharp spike in public interest in artificial intelligence (AI) and associated fields. Although research in the field of Natural Language Processing (NLP) has been on for a few decades with some major breakthroughs in the last decade, it was ChatGPT that stole the spotlight. Be it due to the fact that it is able to answer questions like a human or has been able to pose based on a prompt or maybe just its simple user-friendly interface, ChatGPT is gaining attention like no other.
The field is progressing at such a pace that before we can understand one model, there is already another ready to come out. Earlier this week, Google announced Bard, a conversation service powered by LaMDA (Language Model for Dialogue Applications). Both ChatGPT and LaMDA are Language Models whose task is to predict the next word. Before we look at what is behind the scenes and the future from here, let us see how we got here while also understanding the basis for all of it.
Intelligence and Language
Cambridge dictionary defines intelligence as the ability to learn, understand, and make judgments or have opinions that are based on reason. As a rudimentary extension, we can call AI a machine’s ability to learn, understand and make judgements or have opinions.
Language is typically defined as a system of communication consisting of sounds, words and grammar. The ability of humans to communicate abstract thoughts is what makes human language different from animal ‘language’. Language is not necessarily a measure of intelligence.
The earliest work known in the field of linguistics can be attributed to Pāṇini, who in his work, Aṣṭādhyāyī, writes down the rules of Sanskrit grammar. His treatise explains the syntactic and semantic structures in Sanskrit. Understanding the structure of the language is one of two main approaches that was deployed in the late 1950s and 1960s to make machines understand natural language.
Noam Chomsky and many other linguistics led the work in this formal language theory. The other paradigm that saw a rise around the same time was that of AI. Researchers like John McCarthy, Marvin Minsky and Claude Shannon were focused on this paradigm. Some others on statistical algorithms and some on reasoning and logic.
History of AI
Early work on AI started post World War II and the name AI itself was coined in 1956. AI can broadly be categorised into four classes — Thinking Humanly, Thinking Rationally, Acting Humanly and Acting Rationally. Turing Test proposed by Alan Turing in 1950 paved the initial direction for research. A machine that possesses the ability to communicate, store information, use that information and adapt it to other situations can be said to pass the Turing Test. A machine that can also perceive objects and manipulate objects or move about can be said to pass the total Turing Test.
History of Chatbots
One of the earliest Question Answering systems was Baseball, created in 1961. Baseball was a program that was able to answer questions asked in simple English. It was considered the first goal towards computers answering questions directly from stored data. As the name suggests, the program was capable of answering questions like “What teams won 10 games in July?” in the domain of the sport — baseball. The answers were not grammatical sentences. They were either a list or yes/no type answers.
Weizenbaum’s ELIZA in 1966 was an early chatbot system that was capable of limited dialogue and imitated the responses of a Rogerian psychotherapist. It was a very simple program that used pattern matching to process the input and generate a suitable output. ELIZA was believed to have passed the Turing Test as many users of the system believed that they were indeed interacting with a human.
A.L.I.C.E. (Artificial Linguistic Internet Computer Entity), created by Richard Wallace in the 1990s is a chatbot written in AIML (Artificial Intelligence Markup Language). It can be used to create bot personalities that have a minimalist response. The following years saw various changes in paradigms with the rise of statistical methods, machine learning and the re-rise of neural networks, which all led NLP to what it is today.
Breakthroughs in Last Decade
A few major advances in the last decade have brought us to where we are today. First, the computing ability that can be packed into smaller cheaper chips. There has been a tremendous reduction in the size and cost of chips coupled with their ability to do faster computations.
Though the basis of neural networks has been around for a few decades, the access to GPUs (graphics processing units), which allow for faster computing, brought it back to the forefront. Deep learning was initially used to solve problems involving images. In the language world, the introduction of transformer architecture in 2017 by Google, based on the attention mechanism introduced in 2014, can be said to be a turning point.
Language Modelling
ChatGPT refers to itself as a Language Model and can also explain what is a language model and the transformer architecture. Language model is the NLP task of predicting the next word given the previous words. It can be thought of as a ‘fill in the blanks’ exercise where all the blanks are always at the end of the given words. Language modelling like other NLP tasks moved to using deep neural networks from statistical methods. The availability of large data and computation has enabled companies to create what are known as large language models or pretrained language models.
OpenAI founded in 2015, introduced GPT (Generative Pre-Training) in 2018, which is also one such model. Its successor GPT-3, introduced in 2020 forms the base for GPT3.5 that is the base for ChatGPT. That is why ChatGPT calls itself a language model.
Though ChatGPT, as seen by the many examples online, has the ability to answer complex questions, it fails in common sense reasoning. That is because ChatGPT does not truly understand the language. All that it can do is generate the next word, thus making sentences and paragraphs. Looking back at AI, ChatGPT is successfully able to act like a human with its responses, but it does not think like a human. When a user gives a prompt to ChatGPT asking it to pose like a scriptwriter and write a script, ChatGPT generates because it has seen enough scripts in its training data to know what a script looks like and not because it suddenly became a scriptwriter.
To put it in simple words, ChatGPT, though the exact training data has not been released, has been trained on 500 billion tokens (can be thought of as words for simplicity). For a better perspective, imagine knowing every piece of text that was published on the internet for a period of three years and using that to generate scripts, papers, code and everything else imaginable without copying from the original text.
How else does ChatGPT learn?
Reinforcement Learning with Human Feedback
Reinforcement learning (RL), unlike supervised and unsupervised learning, has a system to learn through rewards. The goal of RL is to maximise the reward. Usually, the entire process is automated and no human involvement is there in the entire process. In RLHF, a human gives feedback on the generated answers, which is then used to calculate the reward.
Let us imagine a child learning a language. Suppose the child utters “I want eat a apple”. The parent may correct the child by uttering “I want to eat an apple”. This sort of exchange can keep happening multiple times and the child’s language gets closer to the natural way. At different points in the exchange, the child can also be rewarded. If the child gets the sentence right after the first correction, the whole apple can be given. One or multiple slices of the apple may be given at different stages of the learning process. Here, the apple is considered the reward. In the case of ChatGPT, there is no child but it is the model that is learning while a human is providing an annotation that can be used to calculate the reward as a score.
Bluffing with Confidence
Other than the already mentioned inability to reason, ChatGPT has a few more limitations. The biggest issue is that of factual accuracy. Since the model does not really understand the meaning, it also does not have the ability to verify facts. Though the model might respond with a ‘I do not know’ for a specific prompt, tweaking the prompt slightly might force it to generate an answer. In other words, it has the ability to bluff with confidence. This is technically known as hallucination.
ChatGPT itself has answered this in multiple questions — that it is not connected to the internet. Though the model looks like a replacement for a search engine, it is far from being one. Other than not being connected to the internet, the model cannot currently provide a source for the answer. Unlike ChatGPT, Bard might be able to circumvent the problem of factuality since LaMDA was introduced with the mechanism of being able to connect with verified external knowledge source.
As seen in GPT-3 and other models, the models reflect the training data. Inadvertently, the training data reflects the bias in society. Though there are some checks in place for ChatGPT, people have found ways to break it.
Besides, cost is not the only concern to train and host these models but the environmental impact of these models also needs to be seen. The energy used to train large models is quite high. Making model training sustainable is research in itself. Finally, looking at the copyright lawsuits against the image generation models, we can’t be sure yet about how copyrights will work in language models.
Making us Jobless?
A growing concern has also been about AI taking away jobs. Though it might not happen immediately, the possibility cannot be ruled out. Looking at our own history, the Industrial Revolution led to a cut in jobs in some sectors but led to an increase in jobs in some other sectors. The only difference between then and now would be that it might be the first time in history where we see white-collared jobs being taken away. Jobs like programmers, copyrighters and graphic designers might all be substituted with people good at writing prompts for the generation models.
Currently, OpenAI is allowing the model to be used for free. With the integration of Bing search engine with ChatGPT, this might not be the case for long. Let us enjoy our conversations with ChatGPT while we sign up for the new Bing and await the announcement of GPT4 and the public release of Bard.
(The author is pursuing PhD in NLP and is a former Senior Software Engineer at Apple, USA. Views are personal)
This content was originally published here.