Why Prolog Might Be the Answer to Better AI Reasoning
OpenAI recently released Structured Outputs, a JSON-based API to help developers improve the output of their models and achieve 100% reasonability. While OpenAI confirms 100% reasonability, there are still chances of errors. This begs the question –  why pursue this approach when similar results could be achieved at a programming language level with Prolog? Prolog, a powerful yet often overlooked programming language brought to the realm of AI, excels at “old-school” symbolic AI tasks such as knowledge-based systems and rule-based natural language processing. Its declarative nature allows developers to specify rules and facts about a problem domain, allowing its interpreter to automatically infer solutions. This makes it one of the best languages for classic AI problems such as search and constraint satisfaction. Prolog also shines in handling uncertain or incomplete data. Programmers can specify rules that might be true or false, and Prolog will reason out the problem to find the most likely and accurate solution given available information. This is a key advantage in real-world AI scenarios where information is often incomplete. Similarly, a study published as part of the International Computer Science Series suggested that Prolog is well-suited for AI development due to its declarative nature, for the very reason that programmers can specify rules and facts, and Prolog’s built-in inference engine can derive conclusions. The report further mentioned that Prolog’s backtracking mechanism allows for efficient searching of solution spaces. The report provides examples of using Prolog for natural language processing tasks like parsing sentences. Prolog’s ability to handle recursive rules and symbolic expressions makes it useful for implementing expert systems and knowledge representation. Prolog in Production Environment IBM’s Watson system, famous for winning Jeopardy, uses Prolog for pattern matching over natural language parse trees. According to the developers, Prolog was chosen for its “simplicity and expressiveness” in specifying pattern-matching rules. “We required a language in which we could conveniently express pattern matching rules over the parse trees and other annotations (such as named entity recognition results), and a technology that could execute these rules very efficiently. We found that Prolog was the ideal choice for the language due to its simplicity and expressiveness” said former IBM senior technical staff member Adam Lally. Meanwhile, Kyndi, an AI company, which was acquired by Qlik earlier this year, used Prolog for its natural language processing software because of its logic-based capabilities. Kyndi founder Ryan Welsh said, “Prolog is more logic-driven and more powerful in its abstract reasoning than modern programming languages such as C++ or Java.” Apparently, TerminusDB, an open-source graph database and document store, has been implemented in Prolog. The choice of Prolog as the implementation language is significant due to, again, its declarative nature and ability to express complex rules, making it well-suited for a deductive database system like TerminusDB. Prolog’s logic-based approach allows TerminusDB to efficiently handle complex queries and reasoning over the stored data. The declarative style of Prolog enables developers to focus on specifying the desired outcomes rather than the step-by-step process of achieving them, which aligns well with the declarative nature of database queries. Furthermore, GeneXus incorporates Prolog as part of its rule-based system for developing smart applications with AI capabilities. Prolog’s declarative and logic-based approach aligns well with specifying business rules and complex application logic. TextRazor, a London-based startup, also performs text analysis using an engine coded in Prolog. “TextRazor uses Prolog as its rules engine. Our system was designed to make common patterns easy to build without technical expertise, while keeping the full power and expressiveness of the Prolog language for more complex tasks,” TextRazor said in a blog. Considering how efficient Prolog is due to its declarative nature, the question is why AI models were not trained through rule-based programming like Prolog? So far it seems like we could have eliminated so many problems within these models with just one change in foundation.
While the JSON-based API can help developers improve the output of their models, with Prolog, models can have better reasoning capabilities from the start.
While the JSON-based API can help developers improve the output of their models, with Prolog, models can have better reasoning capabilities from the start.
["AI programming"]
["AI programming", "API", "TPU", "OpenAI", "AI", "programming_languages:R", "programming_languages:Java", "C++", "R", "Java", "startup"]
["AI", "OpenAI", "TPU", "R", "Java", "C++", "API", "startup", "programming_languages:R", "programming_languages:Java"]
A software engineer who loves to experiment with new-gen AI. He also happens to love testing hardware and sometimes they crash. While reviving his crashed system, you can find him reading literature, manga, or watering plants.