ChatGPT is a large-scale language model developed by OpenAI. It was trained using a massive dataset of texts available on the Internet to learn how to generate conversational text in multiple languages. It is programmed using a neural network architecture known as the «Transformer», which enables efficient processing of large volumes of textual data.
The «Transformer» technology is similar to the cosine similarity algorithm. Both aim to measure the similarity between two vectors. In the case of ChatGPT’s attention mechanism, it is used to measure the similarity between the vector of the current token and each of the vectors in the input sequence, generating an attention matrix.
In the context of a language model such as ChatGPT, the input token refers to the text or set of words provided as input to the model. The model uses this input to generate a response or continuation of the text. Regarding the current token, it refers to a specific unit of processing or a particular word within the set of input tokens; the model processes these tokens one by one to generate a coherent response. In general terms, the current token refers to the word or set of words that the model is processing at a given moment while generating a response, whereas the input token refers to the set of words or text provided as input to the model.
Subsequently, a softmax function is applied to each element of the matrix to obtain an attention distribution, which is then used to weight the elements of the value matrix. The cosine similarity algorithm is also employed to measure the similarity between two vectors. Specifically, the cosine of the angle between two vectors is calculated and used as a measure of similarity.
For example, consider the input: «El perro corre en el parque»; the input is fed into an embedding layer, where each token is converted into a numerical vector. Each of these vectors represents a semantic feature of the token. The embedding vectors are then passed into an attention layer, where relationships between tokens are analyzed. For instance, it can be determined that «perro» and «corre» are related and that «parque» is the location where the action occurs. The vector representation generated in the attention layer is fed into an encoding layer, where additional operations are applied to analyze the text and produce a more detailed representation. For example, it can be determined that the action of «correr» is performed by the subject «perro» in a specific location, «parque». The representation generated in the encoding layer is used by the decoding layer to generate a coherent and natural response. For instance, the response «El perro está corriendo en el parque» may be generated.
Embedding vectors are generated through an automated training process in which the algorithm is provided with a large text dataset and trained to learn how to associate each token with a numerical vector. These vectors are then used as input for the natural language processing model. Embedding vectors possess several interesting properties, such as semantic similarity—meaning that similar words will have similar vectors—enabling the model to develop a semantic understanding of language and perform tasks such as text classification, text generation, machine translation, and others.
An approximate and simplified mathematical formula for ChatGPT’s attention algorithm is as follows:
atten = softmax(Q * K^T / sqrt(d_k)) * V
Where:
- Q is the query matrix, representing the current token being processed
- K is the key matrix, representing each token in the input sequence
- V is the value matrix, representing the meaning of each token
- d_k is the dimensionality of the key vectors
The softmax function is used to compute an attention distribution—that is, a set of weights indicating how much attention should be paid to each token in the input sequence; this constitutes a probability distribution. Multiplying the value matrix by the attention distribution produces the attention vector, which represents the importance of each token in the input sequence with respect to the current token.
What ChatGPT Can Do
Generate texts, complete sentences, answer questions based on its knowledge base, summarize content, classify texts, perform translations, generate code, and therefore program. All these capabilities can be adapted to any environment and context, enabling the automation of many tasks typically performed by information professionals. For example, indexing and summarization, cataloging, content classification, development of documentary languages, thesauri, ontologies, content curation, publications, and articles. Moreover, it can also develop complex services such as information retrieval, reference and information services, resource collection, and nearly any task within the Internet environment. In fact, if asked about the tasks and services it can perform in the context of Library and Information Science, ChatGPT’s response is forceful and surprising…
In the context of specialized and university libraries…
Resource search and retrieval: assisting users in finding relevant resources within the specialized library or information databases; Research consultation: providing guidance to researchers on how to locate and utilize resources pertinent to their research projects; Catalog interaction: helping users search for and reserve materials in the specialized library’s catalog; Information on services: providing details about services available at the specialized library, such as material lending, database access, etc.; Remote access: enabling users to access the specialized library’s resources through a chatbot interface; Automation of administrative tasks: performing administrative duties such as tracking loans, managing reservations, etc.; Annotations and recommendations: allowing users to annotate and recommend resources in the specialized library; Statistics generation: generating statistics on the usage of the specialized library’s resources; Advanced search: offering advanced search options to help users find more precise and relevant information; Integration with other tools: integrating with other specialized library and university tools, such as library management systems and scientific publishing platforms; Accessibility: providing access to resources in various formats for individuals with disabilities; Personalization: tailoring the user experience based on their preferences and usage history; Data analysis: analyzing data on the use of the specialized library’s resources to enhance user experience and inform decisions regarding resource acquisition; Real-time interaction: delivering immediate responses to users’ questions and inquiries; Indexing and metadata services: providing indexing and metadata services to describe and organize the specialized library’s resources; Repository services: offering repository services for storing and sharing scientific data and resources; Editing and proofreading services: providing editing and proofreading services to ensure that the specialized library’s resources comply with institutional and university standards and styles; Archiving and preservation services: offering archiving and preservation services to safeguard important resources of the specialized library; Training services: delivering training to users on how to use the resources and services of the specialized library; Translation services: providing translation services for resources in different languages; Documentation services: offering documentation services, such as registering the specialized library’s publications and preparing reports.
In the context of documentation in the company…
Document search and retrieval: assist employees in finding relevant documents within the company’s document management system; Document classification and organization: help employees efficiently classify and organize company documents; Document creation and editing: enable employees to create and edit documents quickly and easily; Document validation and approval: assist employees in validating and approving documents in accordance with company policies and procedures; Remote document access: allow employees to access company documents from any location and device via a chatbot interface; Automation of administrative tasks: perform administrative tasks such as managing document access permissions and document version control; Integration with other tools: integrate with other company tools such as email, calendar, and project management applications to enhance efficiency and collaboration; Document annotations and comments: allow employees to add annotations and comments to documents to facilitate collaboration and review; Report generation: generate reports on company document usage and active users; Information security: ensure the security of company documents through security measures such as encryption and user authentication; Translation services: provide translation services for documents in different languages; Editing and proofreading services: offer editing and proofreading services to ensure documents comply with company standards and styles; Archiving and preservation services: provide archiving and preservation services to safeguard important company documents; Training services: train employees on how to use the company’s documentation resources and services.
Testing ChatGPT
Given the vast potential of ChatGPT, we decided to test it by assigning complex tasks that would typically require a documentation specialist to perform. These tasks are: 1) CDU classification test; 2) Thesaurus construction test; 3) Programming an automatic classification software test; 4) Information retrieval and search test.
1. CDU Classification Test – prueba1-chatgpt-cdu PDF
The classification test was highly surprising. Complex classification topics were posed, such as “nanoparticles for cerebral neurostimulation in the treatment of diseases like Alzheimer’s” or “Development of conversational robots using natural language processing and algorithms for dimensionality reduction and vector space representation, along with calculation of similarity coefficients or cosine coefficients.” These were reasonably well resolved. This demonstrates that the bot is capable of correctly interpreting the meaning of the questions posed, incorporates various decimal classifications, and can deduce the most appropriate or correct answer for each context, providing a coherent classification number. Although it still generates some errors in nomenclature usage, these appear relatively easy to correct, and it shows a very promising classification potential that could significantly reduce the time a documentalist or librarian would need to complete such tasks.
2. Test on the Development of a Thesaurus – prueba2-chatgpt-tesauro PDF
The thesaurus development test involved establishing the head term “Urbanism,” around which a list of candidate terms was to be generated for constructing a hierarchical structure according to their level of specificity. ChatGPT selected 40 candidate terms based on its assessment of relevance and pertinence. It was then asked to represent this hierarchy at three levels. Although the selection of terms may be debatable, its organization was accurate, rapid, and efficient. It clearly distinguishes the degree of specialization among terms. It is also capable of adding TC, TE, TG, TE1, TE2 indicators, as well as related terms; introducing new terms not previously mentioned; editing the output based on user-provided information; and even adding translations of terms to transform it into a multilingual thesaurus.
3. Test on Programming an Automatic Classification Software – prueba3-chatgpt-programa PDF
One of ChatGPT’s capabilities is its ability to develop programs and write code in a wide variety of programming languages. In this instance, the task proposed is the development of an automatic classification program in PHP capable of executing SQL queries on a MySQL database containing a table with the knowledge base (i.e., the documents to be classified). Although at the beginning of the test the bot considers the task too broad and requiring further specification, it nonetheless provides an initial approximation of the code by establishing database connections and the basic conditional structure to initiate the automatic classification project. Subsequently, for ChatGPT to proceed with developing the code, it is necessary to clarify that it is being evaluated and to direct it to elaborate on one of the program’s multiple functions. In this case, it begins to provide more precise code that aligns with the initial framework and context. In other words, the programming developed by the bot requires supervision and specific instructions to provide key project parameters—for example, the type of algorithm to use, thresholds, limits, data processing methods, classification categories, types of classification, etc. Once these are defined, ChatGPT can implement and update them within the code it has written. Thus, it can be said that ChatGPT is capable of developing complex programs, but only with appropriate guidance; in such cases, subsequent editing and adaptation of the generated code will still be required. One cannot expect the code to function perfectly on the first attempt. Nevertheless, this represents a significant advancement that can enhance productivity and facilitate the creation of systems and automations.
4. Information Retrieval and Search Test – prueba4-chatgpt-buscar PDF
The search and information retrieval capabilities are limited to the pre-established knowledge base used during training. This means that ChatGPT does not have real-time access to the Web. This constitutes a limitation when providing results, as evident in the test. However, the paid version, also known as ChatGPT-3, is capable of performing searches on Google, thereby possessing a fundamental capability for delivering information and reference services, including access to bibliographic catalogs, scientific databases, or any other information resource.
Conclusions
It can be concluded that, despite ChatGPT not being perfect and having gaps and limitations—particularly in its internet search and information retrieval capabilities, at least in its open version—it exhibits remarkable abilities and potential. The capacity to create thesauri, classify, program, catalog, and perform many tasks typically carried out by information professionals makes it a powerful tool when used correctly. It also represents a threat to professional activities traditionally performed by librarians, archivists, documentalists, and information specialists, as it could automate a significant portion of their tasks. This necessitates reflection on the functions, roles, and high-value-added tasks that should be developed within the context of Documentation, requiring the redesign and convergence of training in appropriate environments increasingly linked to information technologies, computer science, and the development of more complex projects demanding higher professional qualifications. Otherwise, there is a risk that within a few years (not too many), such systems will render partially obsolete the work currently being carried out. Therefore, attention must be paid to these advances, and professionals must be able to adapt to change by introducing new content more aligned with the sector’s actual needs and anticipating the inevitable changes ahead.
Related bibliography
- Alshater, M. (2022). Exploring the role of artificial intelligence in enhancing academic performance: A case study of ChatGPT. Available at SSRN. https://dx.doi.org/10.2139/ssrn.4312358
- Anders, B. A. (2023). Why ChatGPT is such a big deal for education. C2C Digital Magazine, 1(18), 4. https://scalar.usc.edu/works/c2c-digital-magazine-fall-2022—winter-2023/why-chatgpt-is-bigdeal-education
- Aydın, Ö., & Karaarslan, E. (2022). OpenAI ChatGPT generated literature review: Digital twin in healthcare. Available at SSRN 4308687. https://dx.doi.org/10.2139/ssrn.4308687
- Azaria, A. (2022). ChatGPT Usage and Limitations. http://azariaa.com/Content/Publications/ChatGPT.pdf
- Castelvecchi, D. (2022). Are ChatGPT and AlphaCode going to replace programmers?. Nature. https://doi.org/10.1038/d41586-022-04383-z
- Castillo-Gonzalez, W. (2022). ChatGPT and the future of scientific communication. Metaverse Basic and Applied Research, 1, 8-8. https://doi.org/10.56294/mr20228
- Cotton, D. R., Cotton, P. A., & Shipway, J. R. (2023). Chatting and Cheating. Ensuring academic integrity in the era of ChatGPT. https://doi.org/10.35542/osf.io/mrz8h
- Deng, J., & Lin, Y. (2022). The Benefits and Challenges of ChatGPT: An Overview. Frontiers in Computing and Intelligent Systems, 2(2), 81-83. https://doi.org/10.54097/fcis.v2i2.4465
- Else, H. (2023). Abstracts written by ChatGPT fool scientists. Nature. https://doi.org/10.1038/d41586-023-00056-7
- Gao, C. A., Howard, F. M., Markov, N. S., Dyer, E. C., Ramesh, S., Luo, Y., & Pearson, A. T. (2022). Comparing scientific abstracts generated by ChatGPT to original abstracts using an artificial intelligence output detector, plagiarism detector, and blinded human reviewers. bioRxiv. https://doi.org/10.1101/2022.12.23.521610
- Gilson, A., Safranek, C., Huang, T., Socrates, V., Chi, L., Taylor, R. A., & Chartash, D. (2022). How Well Does ChatGPT Do When Taking the Medical Licensing Exams? The Implications of Large Language Models for Medical Education and Knowledge Assessment. medRxiv. https://doi.org/10.1101/2022.12.23.22283901
- Shijaku, R., & Canhasi, E. ChatGPT Generated Text Detection. https://www.researchgate.net/profile/Ercan-Canhasi/publication/366898047_ChatGPT_Generated_Text_Detection/links/63b76718097c7832ca932473/ChatGPT-Generated-Text-Detection.pdf
- Stokel-Walker, C. (2022). AI bot ChatGPT writes smart essays—should academics worry?. Nature. https://doi.org/10.1038/d41586-022-04397-7
- Tutek, M. ChatGPT: What can large pretrained language models say about the future? https://www.ieee.hr/_download/repository/ChatGPT__What_can_large_PLMs_say_about_the_future.pdf
- Zhai, X. (2022). ChatGPT user experience: Implications for education. Available at SSRN 4312418. https://dx.doi.org/10.2139/ssrn.4312418