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 amounts of textual information. 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 a continuation of the text. Regarding the current token, it refers to a unit of processing or a specific 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 computed and used as a measure of similarity. For example, consider the input: «The dog runs in the park»; 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 «dog» and «runs» are related and that «park» 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 generate a more detailed representation. For example, it can be determined that the action of «running» is performed by the subject «dog» in a specific location, the «park». The representation generated in the encoding layer is used by the decoding layer to produce a coherent and natural response. For instance, the response «The dog is running in the park» may be generated. The embedding vectors are created through an automated training process in which the algorithm is provided with a large corpus of text 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 achieve semantic understanding of language and perform tasks such as text classification, text generation, machine translation, among 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 dimension of the key vectors
The softmax function is used to compute an attention distribution, i.e., a set of weights indicating how much attention should be paid to each token in the input sequence; this is a probability distribution. The multiplication of the value matrix with the attention distribution enables the generation of an attention vector, which represents the importance of each token in the input sequence for 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 confined to the Internet environment. In fact, if asked about the tasks and services it can perform within 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: assist users in finding relevant resources in the specialized library or information databases; Research guidance: provide researchers with advice on how to locate and utilize resources relevant to their research projects; Catalog interaction: help users search for and reserve materials in the specialized library’s catalog; Information on services: provide information about services available at the specialized library, such as material lending, database access, etc.; Remote access: enable users to access the specialized library’s resources through a chatbot interface; Automation of administrative tasks: perform administrative tasks such as tracking loans, managing reservations, etc.; Annotations and recommendations: allow users to annotate and recommend resources in the specialized library; Statistics generation: generate statistics on the usage of the specialized library’s resources; Advanced search: provide advanced search options to help users find more precise and relevant information; Integration with other tools: integrate with other specialized library and university tools, such as library management systems and scientific publishing platforms; Accessibility: provide access to resources in various formats for people with disabilities; Personalization: tailor the user experience based on their preferences and usage history; Data analysis: analyze data on the use of the specialized library’s resources to improve the user experience and make informed decisions regarding resource acquisition; Real-time interaction: provide real-time responses to users’ questions and inquiries; Indexing and metadata services: offer indexing and metadata services to describe and organize the specialized library’s resources; Repository services: provide repository services for storing and sharing scientific data and resources; Editing and proofreading services: offer editing and proofreading services to ensure that the specialized library’s resources comply with library and university standards and styles; Archiving and preservation services: provide archiving and preservation services to safeguard important resources of the specialized library; Training services: deliver training to users on how to use the resources and services of the specialized library; Translation services: offer translation services for resources in different languages; Documentation services: provide 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 multiple 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 as follows: 1) Dewey Decimal Classification test; 2) Thesaurus construction test; 3) Programming test for an automatic classification software; 4) Information retrieval and search test.
- CDU Classification Test – prueba1-chatgpt-cdu PDF. The classification test yielded surprisingly positive results. Complex classification topics were posed, such as «nanoparticles for cerebral neurostimulation in the treatment of diseases such as Alzheimer’s» or «Development of conversational robots using natural language processing, vector space reduction and representation algorithms, as well as 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, incorporating multiple decimal classifications, and deducing the most appropriate or correct answer for each context by providing a coherent classification number. Although it still produces some errors in nomenclature usage, these appear relatively easy to correct, and it shows considerable potential for classification that could significantly reduce the time required by a documentalist or librarian to perform this task.
- Test for the Development of a Thesaurus – prueba2-chatgpt-tesauro PDF. The test for the development of a thesaurus involved establishing a head term, “Urbanism,” around which a list of candidate terms must be generated to construct a hierarchical structure according to their level of specificity. ChatGPT selected 40 candidate terms based on its criteria of relevance and pertinence. It was then asked to represent these terms in a three-level hierarchy. Although the selection of terms may be debatable, its organization was accurate, rapid, and efficient. It clearly distinguishes the degree of specialization among the terms. It is also capable of adding TC, TE, TG, TE1, TE2 indicators, as well as related terms; introducing new terms not previously referenced; editing the output using user-provided information; and even adding translations of the terms to convert it into a multilingual thesaurus.
- Programming Test of an Automated 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 automated 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 outset of the test the bot considers the task too broad and requiring further specification, it nevertheless provides an initial code approximation by establishing database connections and defining the basic conditional structure to initiate the automated classification project. Subsequently, for ChatGPT to proceed with developing the code, it is necessary to clarify that it is being evaluated and to request deeper elaboration of one of the program’s multiple functions. In this case, it begins to provide more precise code aligned with the initial requirements 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 be used, thresholds, limits, data processing methods, classification categories, types of classification, etc. Once these are specified, ChatGPT can implement and update them within the code it has written. Thus, it can be said that ChatGPT is capable of producing complex programs, but only with appropriate guidance; in such cases, subsequent editing and adaptation of the generated code will still be necessary. One cannot expect the code to function perfectly on the first attempt. Nevertheless, this represents a significant advancement that can greatly enhance productivity and facilitate the development of systems and automations.
- Information Search and Retrieval Test – prueba4-chatgpt-buscar PDF. The capabilities for information search and retrieval 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 in delivering results, as evident in the test. However, the paid version, also known as ChatGPT-3, is capable of performing searches on Google, which implies a fundamental capacity for providing 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 advancements, and professionals must be able to adapt to change by incorporating 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