# Towards AI-Generated Essay Classification Using Numerical Text Representation
## 3 Natural Language Processing
### Large Language Models  
Language models are computational systems capable of understanding and generating text in natural language. They possess the transformative ability to predict the likelihood of a given sequence of words or generate new text based on specified input data [24]. The most commonly encountered type of language models are those based on n-grams. These models estimate word probabilities based on context to predict the next element in a sequence. Large language models (LLMs) are advanced language models with a large number of parameters and characterized by high learning capabilities [24]. The core of most large language models, such as GPT-3 [25] and GPT-4 [26], is the neural network transformer architecture [23]. This architecture eliminates the sequential nature of the problem. Instead of processing data word by word, transformers capture dependencies in the text by considering the entire sequence at once [24]. Another common feature of LLMs is contextual learning, where the model is trained to generate text based on a specific context or prompt, which serves as an instruction or command [27]. This allows for generating more coherent and contextually appropriate responses, which is particularly important for interactive and conversational applications. A significant aspect of LLMs is reinforcement learning from human feedback (RLHF). This technique involves fine-tuning the model based on human-generated responses, significantly improving the quality of answers and performance over time [28]. Most LLMs also utilize transfer learning as a fine-tuning technique. The pre-trained models are adapted to specific tasks using task-specific data [29]. There is a growing trend towards models fine-tuned for specific tasks and open-source models. It is worth noting that the first pre-trained models, such as T5 [30] and mT5 [31], utilized transfer learning. The advent of GPT-3 demonstrated that large language models could be used for various tasks without additional fine-tuning [27]. Consequently, the innovative technique of zero-shot learning emerged, allowing models to sample unseen classes during training. Few-shot learning, where the model has a limited number of samples for a task not included in its original training, has also gained popularity. Few-shot learning often results in higher accuracy for solutions provided by LLMs compared to zero-shot learning. Moreover, fine-tuning models that employ both zero-shot and few-shot learning significantly enhances their ability to handle new tasks [29]. Sequential learning is a crucial aspect of LLMs, enabling them to generate fluent text. This forms the foundation for autoregressive models which improve themselves without human intervention. An example of such a model is GPT-3 [24]. The concept of sequential learning is to predict the next tokens in a sequence based on the previous context. Given a context sequence \(X\), the model's task is to predict the next token \(y\). The model is trained by maximizing the probability of a given token sequence conditioned on the context [24]:  
\[P(y|X)=P(y_{t}|x_{1},x_{2},\ldots,x_{t-1}) \tag{5}\]  
where  
* \(x_{1},x_{2},\ldots,x_{t-1}\)--the tokens in the context sequence,
* \(t\)--the current position. Using the chain rule, this conditional probability can be decomposed into the product of probabilities for previous tokens [24]:  
\[P(y|X)=\prod_{t=1}^{T}P(y_{t}|x_{1},x_{2},\ldots,x_{t-1}) \tag{6}\]  
where  
* \(T\) is the length of the sequence. In this way, the model predicts each token at each position autoregressively, generating a complete text sequence. In summary, the model analyses previous text fragments (the context) and then predicts which token should appear next based on what it has already \"seen\". This process occurs sequentially, with each subsequent prediction being based on previous text fragments. Another important aspect of large language models is the use of attention mechanisms.