<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Towards NeSy - Medium]]></title>
        <description><![CDATA[NeSy is the next big idea of AI that introduces reasoning ability into the deep neural networks. We welcome short, non-serious, but clear blogs of fun papers/ideas. - Medium]]></description>
        <link>https://medium.com/towards-nesy?source=rss----f37f46392a6e---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Towards NeSy - Medium</title>
            <link>https://medium.com/towards-nesy?source=rss----f37f46392a6e---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:18:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/towards-nesy" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Logic in the Era of Artificial Intelligence: Common Logic Grammar Construction Framework]]></title>
            <link>https://medium.com/towards-nesy/logic-in-the-era-of-artificial-intelligence-common-logic-grammar-construction-framework-b0e4d14fe6f5?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/b0e4d14fe6f5</guid>
            <category><![CDATA[syllogism]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[neurosymbolic-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[logic]]></category>
            <dc:creator><![CDATA[Hanna Abi Akl]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 23:40:51 GMT</pubDate>
            <atom:updated>2026-08-01T23:40:49.982Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 2: A symbolic toolkit for a neuro-symbolic pipeline</p><p>In <a href="https://medium.com/@hannaabiakl8/a666faa827c7">Part 1</a>, we discussed the place of <em>Logic</em> in Artificial Intelligence (AI) with the rise to prominence of Language Models (LMs). We also explained the importance of evaluating LMs on tasks involving reasoning like solving syllogisms. But syllogisms can be expressed in different logical notations (e.g. natural language, first-order logic, etc.) and different representations introduce different complexities that may improve (or hinder) reasoning.</p><p>An interesting question arises: <em>How does representing a syllogism in different logical notations affect model reasoning? </em>To answer, we need a tool to quickly and automatically translate syllogisms from one logical notation to another.</p><h4>Introducing the Common Logic Grammar Construction Framework</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/0*tlR92UKLX-6tg4xX.png" /><figcaption>Figure 1: The CLGC toolkit logo. <a href="https://github.com/HannaAbiAkl/clgc">Source</a></figcaption></figure><p>The <strong>Common Logic Grammar Construction (CLGC)</strong>¹ framework is a symbolic toolkit that automatically generates syllogisms in a logical notation. It is currently implemented as an open source Python package and, to the best of our knowledge, is the first package of its kind to treat syllogisms as objects (other Python libraries exist for manipulating syllogisms², but they mainly treat them as basic strings).</p><p>CLGC³ is also the first toolkit to work with existing yet under-represented logical notations like the Common Logic Interchange Format (CLIF)[1] and Term Functor Logic (TFL)[2].</p><h4>Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*2pcfb3QsbdtSXAjz.png" /><figcaption>Figure 2: Architecture of the CLGC toolkit. <a href="https://github.com/HannaAbiAkl/clgc">Source</a></figcaption></figure><p>The CLGC toolkit architecture is based on the principles of Object-Oriented Programming (OOP)⁴ design and is easily extensible. The base class is an abstract <em>Notation</em> class and all logical notations are treated as children classes derived from it. The first “usable” class is the First-Order Logic (FOL)⁵ notation since it is a widely-used and human-friendly language for knowledge representation in logic, as in the case of syllogisms[3].</p><p>From FOL, it is easy to extend to other Knowledge Representation (KR) notation families. Figure 2 shows examples of KR suites and their notations currently available in CLGC. The package architecture also allows for creating custom notations such as our MINIFOL<em>x</em>[4] from Figure 2.</p><h4>Creating a Notation</h4><p>In CLGC, any notation is defined by a <strong>Backus-Naur Form (BNF)⁶ grammar</strong>. To create a new notation <em>N</em>, the user must provide its BNF grammar. CLGC will be able to generate syllogisms in <em>N</em> as well as translate syllogisms between <em>N</em> and other available notations (e.g. FOL). Since the main goal of CLGC is neuro-symbolic (NeSy) integration with LMs (i.e. generating syllogisms in different KR notations to assess a model’s reasoning abilities), we recommend adopting the following criteria as guiding questions when defining a new notation:</p><ul><li><strong>Verbosity:</strong> Is the notation compact or verbose?</li><li><strong>Frequency:</strong> Is the notation seen (or does it look like something seen) or unseen by a model during initial pre-training?</li><li><strong>Abstraction:</strong> Is the notation closer to natural (e.g. English) or mathematical (e.g. TFL) language?</li><li><strong>Representation:</strong> What is the finiteness of the notation vocabulary and syntax (i.e. a fixed vocabulary of symbols or ambiguous combinations like English)?</li></ul><h4>Key Features</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/0*xO3hSeJ50DsmxMqO.png" /><figcaption>Figure 3: CLGC key features. <a href="https://github.com/HannaAbiAkl/clgc">Source</a></figcaption></figure><p>Figure 3 shows the features currently supported by CLGC:</p><ul><li><strong>Manipulation:</strong> Since syllogisms are treated like objects initialized through a given logical notation, they can be freely manipulated. The smallest manipulable unit is a proposition (i.e. a statement). Since syllogisms are made of propositions⁷, they can be extended (i.e. adding new propositions) or altered (i.e. replacing or deleting propositions).</li><li><strong>Translation:</strong> Syllogisms can be translated from one logical notation to another.</li><li><strong>Validation:</strong> Syllogisms written in a given logical notation can be checked for syntactic construction. This is especially useful when new notations are introduced or when syllogisms are translated from one notation to another.</li><li><strong>Categorization:</strong> Syllogisms can be categorized based on types[4]. This is especially useful when tracing reasoning strengths and weaknesses of a language model when it is exposed to different types of syllogisms.</li></ul><h4>Setup</h4><p>Start by installing the CLGC package</p><pre>pip install clgc</pre><p>Then install the dependencies</p><pre>pip install -r requirements.txt</pre><p>To load all functionalities</p><pre>from clgc.__base import *</pre><h4>Basic Usage</h4><p>To create a valid syllogism in a given notation, each proposition of the syllogism should be followed by the newline &#39;\n&#39; terminator. The following example creates a syllogism of 2 premises and a conclusion in FOL.</p><pre>fol_syllogism = FOLSyllogism(&quot;∀x (Bikes(x) → ¬Calledcars(x))\n ∀x (Bike(x) → Vehicle(x))\n ∃x (Vehicles(x) ∧ Bikes(x))\n&quot;)</pre><p>To categorize syllogisms</p><pre>fol_syllogism = FOLSyllogism(&quot;∀x (Bikes(x) → ¬Calledcars(x))\n ∀x (Bike(x) → Vehicle(x))\n ∃x (Vehicles(x) ∧ Bikes(x))\n&quot;)<br>print(fol_syllogism.categorize())<br># categorical</pre><p>To translate between notations (here, from FOL to TFL+)</p><pre># create syllogism in FOL<br>fol_syllogism = FOLSyllogism(&quot;∀x (Bikes(x) → ¬Calledcars(x))\n ∀x (Bike(x) → Vehicle(x))\n ∃x (Vehicles(x) ∧ Bikes(x))\n&quot;).syllogism<br># convert to desired logical notation - here TFL+<br>tfl_plus_syllogism = FOLSyllogism.fol_to_tfl_plus(fol_syllogism)<br><br>print(tfl_plus_syllogism)<br># -(+B0--+C0)-(+B0-+V0)+(+V1++B1)</pre><h4>Manipulating Syllogisms</h4><p>A list of functions are available to manipulate syllogisms:</p><ul><li>add_statements (automatically adds the given statements in that order — meaning the last given statement becomes the conclusion of the syllogism)</li><li>add_premises (automatically keeps the original conclusion and adds everything given as premises)</li><li>add_conclusion (automatically adds the given statement as the conclusion and makes everything else a premise)</li></ul><p>An example of adding new statements</p><pre>fol_syllogism = FOLSyllogism(&quot;∃x (Canine(x) ∧ ¬AquaticCreatureKnownAsFish(x))\n&quot;)<br>fol_syllogism.add_statements([&quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))\n&quot;])   <br><br>print(fol_syllogism.statements)<br># [&quot;∃x (Canine(x) ∧ ¬AquaticCreatureKnownAsFish(x))&quot;, &quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))&quot;])</pre><p>An example of adding new premises</p><pre>fol_syllogism = FOLSyllogism(&quot;∃x (Canine(x) ∧ ¬AquaticCreatureKnownAsFish(x))\n ∀x (Bike(x) → Vehicle(x))\n&quot;)<br>fol_syllogism.add_premises([&quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))\n&quot;]) <br><br>print(fol_syllogism.premises)<br># [&quot;∃x (Canine(x) ∧ ¬AquaticCreatureKnownAsFish(x))&quot;, &quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))&quot;]</pre><p>An example of adding a new conclusion</p><pre>fol_syllogism = FOLSyllogism(&quot;∃x (Canine(x) ∧ ¬AquaticCreatureKnownAsFish(x))\n ∀x (Bike(x) → Vehicle(x))\n&quot;)<br>fol_syllogism.add_conclusion(&quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))\n&quot;) <br><br>print(fol_syllogism.conclusion)<br># &quot;∀x (Fish(x) → ¬MammalThereforeEveryCanineFallUnderTheCategoryOfMammal(x))&quot;</pre><h4>Integration</h4><p>CLGC can be integrated with other logic programming libraries. The current supported integration is with <a href="https://github.com/MNoorFawi/pytholog/tree/master?tab=readme-ov-file">Pytholog</a>.</p><p>The below example is adapted from Pytholog to show how CLGC objects can be used as validators for logical programming notations like <a href="https://en.wikipedia.org/wiki/Prolog">Prolog</a>.</p><pre>import pytholog as pl<br>from clgc.__base import *<br><br># define a knowledge base in Pytholog<br>clgc_kb = pl.KnowledgeBase(&quot;clgc_flavor&quot;)<br># define a list of facts in CLGC<br>clgc_list = [&quot;likes(noor, sausage)&quot;,<br>        &quot;likes(melissa, pasta)&quot;,<br>        &quot;likes(dmitry, cookie)&quot;,<br>        &quot;likes(nikita, sausage)&quot;,<br>        &quot;likes(assel, limonade)&quot;,<br>        &quot;food_type(gouda, cheese)&quot;,<br>        &quot;food_type(ritz, cracker)&quot;,<br>        &quot;food_type(steak, meat)&quot;,<br>        &quot;food_type(sausage, meat)&quot;,<br>        &quot;food_type(limonade, juice)&quot;,<br>        &quot;food_type(cookie, dessert)&quot;,<br>        &quot;flavor(sweet, dessert)&quot;,<br>        &quot;flavor(savory, meat)&quot;,<br>        &quot;flavor(savory, cheese)&quot;,<br>        &quot;flavor(sweet, juice)&quot;,<br>        &quot;food_flavor(X, Y) :- food_type(X, Z), flavor(Y, Z)&quot;,<br>        &quot;dish_to_like(X, Y) :- likes(X, L), food_type(L, T), flavor(F, T), food_flavor(Y, F), neq(L, Y)&quot;]<br># validate if every fact in the list is in prolog<br># if so, add it to the db<br># if not, interrupt the program<br>for statement in clgc_list:<br>    prolog_syllogism = FOLSyllogism(statement + &quot; .\n&quot;)<br>    try:<br>        # translate CLGC facts from FOL to PROLOG<br>        prolog_syllogism.validate(grammar=&#39;PROLOG&#39;) <br>    except Exception as e:<br>        raise Exception(f&quot;Failed to parse Prolog string: {e}&quot;)<br><br># now everything that is added is valid<br>clgc_kb(clgc_list)<br><br># query the db in clgc<br>query_str = &quot;likes(noor, sausage)&quot;<br>query = FOLSyllogism(statement + &quot; .\n&quot;)<br># check if query is valid<br># if yes, query the db for an answer<br># if not, interrupt the program<br>try:<br>    query.validate(grammar=&#39;PROLOG&#39;)<br>    print(clgc_kb.query(pl.Expr(query_str)))<br>except Exception as e:<br>    raise Exception(f&quot;Failed to parse Prolog string: {e}&quot;)<br># [&#39;Yes&#39;]</pre><p><strong><em>Note: You should make sure to install the dependencies of the target library integrations.</em></strong></p><h4>NeSy Reasoning with CLGC and LMs</h4><p>As a final note, CLGC can be leveraged as a symbolic interface to generate KR notations for experiments involving LM reasoning. Models can be prompted with the same syllogism in different notations to assess the effects on their reasoning abilities. In doing so, CLGC paves the way for new avenues in neuro-symbolic KR research.</p><h4>Footnotes</h4><p>¹ The name is an ode to <a href="https://en.wikipedia.org/wiki/John_F._Sowa">John Sowa</a>, who advocated the <a href="https://en.wikipedia.org/wiki/Common_Logic">Common Logic</a> suite of representations.</p><p>² See <a href="https://github.com/czrptr/syllogism-solver">Sylo</a> and <a href="https://pypi.org/project/syllogistic/">Syllogistic</a>.</p><p>³ See the official GitHub repository <a href="https://github.com/HannaAbiAkl/clgc">here</a> and published package <a href="https://pypi.org/project/clgc/">here</a>.</p><p>⁴ See <a href="https://en.wikipedia.org/wiki/Object-oriented_programming">here</a>.</p><p>⁵ See <a href="https://en.wikipedia.org/wiki/First-order_logic">here</a>.</p><p>⁶ See <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">here</a>.</p><p>⁷ See <a href="https://medium.com/@hannaabiakl8/a666faa827c7">here</a>.</p><h4>References</h4><p>[1] Sowa, John F. “Conceptual graphs.” <em>Foundations of artificial intelligence</em> 3 (2008): 213–237.</p><p>[2] Manzano, José Martín Castro. “An intermediate term functor logic.” (2019).</p><p>[3] Wapniarski, Karol, and Mariusz Urbanski. “Exploring Aristotelian Syllogistic in First-Order Logic: An Overview of the History and Reality of Ontological Commitments.” <em>Proceedings of the 14th Panhellenic Logic Symposium, Kavvos, A. and Gregoriades, V.(eds.), Aristotle University of Thessaloniki</em>. 2024.</p><p>[4] Abi Akl, Hanna, et al. “Are you Talking Logic to Me? Assessing Language Models Syllogistic Reasoning Capabilities.” <em>RuleML+ RR 2026–10th International Joint Conference on Rules and Reasoning</em>. 2026.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0e4d14fe6f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/logic-in-the-era-of-artificial-intelligence-common-logic-grammar-construction-framework-b0e4d14fe6f5">Logic in the Era of Artificial Intelligence: Common Logic Grammar Construction Framework</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logic in the Era of Artificial Intelligence: A Case Study on Syllogisms]]></title>
            <link>https://medium.com/towards-nesy/logic-in-the-era-of-artificial-intelligence-a-case-study-on-syllogisms-a666faa827c7?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/a666faa827c7</guid>
            <category><![CDATA[logic]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[neurosymbolic-ai]]></category>
            <category><![CDATA[syllogism]]></category>
            <dc:creator><![CDATA[Hanna Abi Akl]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 10:21:51 GMT</pubDate>
            <atom:updated>2026-08-01T10:21:49.443Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1: Philosophy and Logic meet Computation and Language Models</em></p><p>Over the last few years, Artificial Intelligence (AI) has gained traction with the advent and continuous introduction of Large Language Models (LLMs). These models have proven capable of handling a wide array of tasks, from Natural Language Processing (NLP) to Computer Vision (CV) and Robotics. Their user-friendly, chat-based interface makes the promise of Artificial General Intelligence (AGI) or Super-intelligence seem far more real than it really is — by conversing in a human-like manner, they effectively convey the notion of intelligence. But a popular question remains: <em>Are they truly intelligent?</em></p><p>This article is not intended to answer that broad question. Rather, it focuses on one aspect of intelligence — <em>Logic</em>.</p><blockquote>You just can’t differentiate between a robot and the very best of humans — Isaac Asimov, I, Robot</blockquote><blockquote>It seems probable that once the machine thinking method has started, it would not take long to outstrip our feeble powers — Alan Turing</blockquote><p>The quotes above are just examples of claims made regarding the promise of AI. A promise, as we can attest to this day, that has failed to live up to its expectations by the performance of LLMs on logical tasks. While these models have made impressive improvements in that domain, any task requiring reasoning makes them falter at different levels. Many researchers have attempted to crack the seemingly unsolvable challenge of making LLMs “smarter” by improving their logical performance on different reasoning problems, but techniques such as Supervise Fine-Tuning and Prompting are starting to show their limits. Interestingly, this paved the way back for Reinforcement Learning (RL), causing it to re-enter the fold.</p><p>Our research group is one of the many interested in the dynamics of LLMs in the context of logical problems. But to investigate the performance of these models on <em>Logic</em>, we first need to define Logic. In simple terms, Logic is about good thinking and good reasoning.</p><h4>An Invitation to Logic</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*rVLameTmpTXo7-w-IdIrPw.png" /><figcaption>Figure 1: A classical logic example. <a href="https://amateurlogician.com/">Source</a></figcaption></figure><p>Logic is first and foremost about <em>Inference </em>(a form of reasoning). <strong>It deals with the ability to derive new propositions from existing ones, thus extending knowledge.</strong> A <em>proposition</em> is a sentence that declare something that can either be True or False.</p><p>A <em>syllogism</em> is a construct based on using 2 or more propositions to derive a new one. This means that syllogisms deal with Inference. Figure 1 illustrates a famous syllogism example. The first 2 propositions are called the <em>premises</em>, and the last proposition is the <em>conclusion </em>of the syllogism.</p><blockquote>All men are mortal</blockquote><blockquote>Socrates is a man</blockquote><blockquote>Thus, Socrates is mortal</blockquote><p>The Socrates example is an example of <a href="https://en.wikipedia.org/wiki/Term_logic">Aristotelian </a>(i.e. traditional) logic. Since then, logic has developed into many forms: <a href="https://plato.stanford.edu/entries/frege-logic/">mathematical logic </a>(Gottlob Frege), <a href="https://en.wikipedia.org/wiki/Propositional_logic">propositional logic,</a> <a href="https://en.wikipedia.org/wiki/First-order_logic">first-order logic</a>, etc.</p><p>These different logics mean there exists different ways to express logical statements and reasoning. This also makes expressing logic a <a href="https://en.wikipedia.org/wiki/Knowledge_representation_and_reasoning">knowledge representation</a> problem. Knowledge Representation (KR) is a key area in AI and reasoning. Many researchers have worked on knowledge representation notations (languages) to best capture logical statements.</p><h4>Logical Notations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*qwdg5ViKwslVU9nu--JhXA.png" /><figcaption>Figure 2: The Common Logic suite of logical notations. <a href="https://www.jfsowa.com/ikl/">Source</a></figcaption></figure><p>Logical notations vary in readability depending on their complexity and expressivity. Among the most used notations is First-Order Logic (FOL) due to it being human-readable. Other notations like the Common Logic (CL) suite are inspired from FOL but try to be more “human” and closer to natural language (i.e. English). Figure 2 shows the CL suite of notations and their varying complexity. This suite groups notations that are widely accepted as being interoperable between humans and machines.</p><p>On the other side of the complexity spectrum are notations like Term Functor Logic (TFL) and Term Functor Logic Plus (TFL+)[1] which are much more abstract, mathematical, and not very “human-friendly”.</p><h4>Why KR matters in Logic</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yFP_dcy_dRd76cpO.png" /></figure><p>Figure 3 demonstrates how complexity varies with the notation used to represent logical statements (i.e. propositions). Notations can vary from natural language-like to mathematical to graphical. Depending on the notation used, reasoning over the problem can become easier or harder.</p><p>One prominent figure in KR who pushed the idea of different logical notations is <a href="https://en.wikipedia.org/wiki/John_F._Sowa">John Sowa</a>. Sowa advocated the importance of the Common Logic suite as a key human-machine interface by introducing notations like the Common Logic Interchange Format (CLIF) and Conceptual Graph Interchange Format (CGIF)[2,3,4,5,6]. The purpose of these notations is to stay in line with popular representations like FOL while providing different “human” ways to read a logic problem.</p><p>Notations like TFL, on the other hand, lean into abstraction by encoding logical problems into mathematical operators (i.e. plus and minus) and retaining the first letters of predicates to represent propositions. Figure 4 illustrates some TFL encoding rules along with an example syllogism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqHHKtBTWkt1eemlr7-QBg.png" /><figcaption>Figure 4: TFL representation of a syllogism example. Source[1]</figcaption></figure><h4>LLMs and Logic</h4><p>What about LLMs? What is their place in all of this? Recall that we set out to investigate how good LLMs are in handling logic problems. To do so, it seems fitting to test them on understanding syllogisms. Specifically, we would like to evaluate if these models can correctly reason and identify if a conclusion logically follows from the premises. Figure 5 illustrates the experiment we described and what we are trying to achieve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fgkC3ygBBB4KH7RWuKP4w.png" /><figcaption>Figure 5: Prompting a model to reason over a syllogism. Source (Author)</figcaption></figure><p>The figure shows that language models can generate syllogisms and determine whether the conclusion follows from the premises. Moreover, these models demonstrate the capacity to represent this kind of logical problem in a logical notation (i.e. FOL) other than natural language. Since LLMs are mainly trained on text (i.e. natural language), tapping into other logical notations opens the door for a knowledge representation experiment and begs the following question : <em>How does representing a syllogism in different logical notations affect model reasoning?</em></p><p>To answer, we need a tool that allows us to freely move between logical notations and generate syllogisms in different logical representations to measure LLM reasoning performance. Stay tuned for Part 2 to find out more!</p><h4>References</h4><p>[1] Manzano, José Martín Castro. “An intermediate term functor logic.” (2019).</p><p>[2] Sowa, John F. “Conceptual graphs.” <em>Foundations of artificial intelligence</em> 3 (2008): 213–237.</p><p>[3] Sowa, John F. “Semantic networks.” <em>Encyclopedia of artificial intelligence</em> 2 (1992): 1493–1511.</p><p>[4] Sowa, John F. “Conceptual graphs summary.” <em>Conceptual Structures: current research and practice</em> 3 (1992): 66.</p><p>[5] Sowa, John. “Conceptual graphs for representing conceptual structures.” <em>Conceptual Structures in Practice</em> (2009).</p><p>[6] Sowa, John F. “Conceptual graphs as a universal knowledge representation.” <em>Computers &amp; Mathematics with Applications</em> 23.2–5 (1992): 75–93.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a666faa827c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/logic-in-the-era-of-artificial-intelligence-a-case-study-on-syllogisms-a666faa827c7">Logic in the Era of Artificial Intelligence: A Case Study on Syllogisms</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026 — When Work Looks Finished Before It Feels Finished]]></title>
            <link>https://medium.com/towards-nesy/2026-when-work-looks-finished-before-it-feels-finished-4a77d2b708e5?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a77d2b708e5</guid>
            <category><![CDATA[phd]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Jesse Jing]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 02:00:23 GMT</pubDate>
            <atom:updated>2026-01-10T02:00:22.438Z</atom:updated>
            <content:encoded><![CDATA[<h3>When Work Looks Finished Before It Feels Finished</h3><h4>On AI, judgment, and learning when to stop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUsMMDkUoQcUO5NhXoM7jw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@dmey503?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Dan Meyers</a> on <a href="https://unsplash.com/photos/a-blurry-image-of-a-couch-in-a-room-7vLpjobIg2k?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Lately, I’ve found myself in a quiet standoff with AI — wanting to trust it more than I’m fully comfortable with.</p><p>As a PhD student, most of my time isn’t spent on big ideas. It’s spent on small, draining tasks: reading papers that blur together, rewriting the same paragraph again and again, cleaning up outputs that are almost right. That’s exactly where AI shows up most aggressively, offering to take over work that used to demand my attention. The temptation is constant. Still, I hesitate. Academia trains you to defend judgment carefully. If something feels too easy, it probably hides a mistake.</p><p>Last year, I crossed that line anyway — slowly, and only where the cost of being wrong felt containable.</p><p>Around the same time, I started noticing the same tension play out elsewhere. Stack Overflow, once essential, began to fade. Its value was built on access to answers, and AI made answers cheap. Grammarly survived because it lived inside the workflow. It didn’t replace thinking — it reduced friction. More importantly, it respected existing expectations about what finished writing looks like. That distinction turned out to matter more than intelligence.</p><p>Seeing this made me think about what kind of AI product people will actually pay for.</p><p>My intuition is simple: the more effort I need to spend fixing an AI’s output, the less I want to pay for it. Not because thinking is bad — but because uncertain cleanup is. If the final stretch still involves second-guessing, context switching, and deciding whether something is “good enough,” the tool has stopped one layer too early. Free products can get away with that. Paid ones can’t.</p><p>Most AI tools do exactly this. They generate something impressive, then quietly retreat, handing the most annoying part back to the user: deciding when it’s finished. That last layer — judgment, confidence, taste — is where trust breaks. It’s also where most of the value is.</p><p>What I was negotiating in my own workflow, companies were fighting over at scale.</p><p>Existing productivity tools already encode answers to this problem, just indirectly. They reflect the routines of specialists, the formats of institutions, and the conventions of professions. Over time, they become mental models. They don’t just help people work; they define what work <em>is</em>, and when it’s done. In return for conformity, they give users permission to stop thinking.</p><p>AI disrupts this bargain. It accelerates output without inheriting the mental models that once absorbed judgment. Work starts to look finished before it feels finished. Responsibility snaps back to the user, who is left reopening decisions they thought were closed.</p><p>This is where the real battles are.</p><p>The fiercest fight in consumer AI will be over everyday workflows — writing, planning, communicating — where existing tools already shape how work is imagined. Changing these mental models is immediately felt and deeply resisted. Incumbents defend them fiercely because they anchor trust. AI-native challengers struggle because replacing a workflow also means replacing the quiet rules that once told users it was safe to stop.</p><p>The longest fight will be over judgment itself. Not what to produce, but how people decide something is done. These mental models are personal, learned slowly, and reinforced by success and failure. Any AI that pushes too hard here feels intrusive. Any that holds back never quite earns trust.</p><p>This becomes clearest in my own work.</p><p>When I’m writing a paper or shaping a story around results, the hardest part isn’t producing text. It’s knowing when to stop touching it. What to emphasize, what to soften, which claim feels strong enough to stand behind. Those decisions still feel personal, and I’m protective of them in a way I’m not with drafts or summaries.</p><p>So when I use AI now, I notice where I tense up. It’s usually not when the output is wrong — it’s when it looks finished too early. That’s the moment I slow down, reread, and take responsibility back. I’ve learned to let the tool do more of the surrounding work, but not cross that line.</p><p>That’s clarified what I actually want from these tools. Not intelligence, and not shortcuts. I want fewer reopened decisions. Fewer moments where I’m left alone asking whether I can stop thinking yet.</p><p>For now, I’m still the one drawing that boundary. Some days I trust the tool a little more; other days I pull back. The interesting question isn’t when AI will be smart enough to decide for me. It’s when I’ll feel comfortable letting it decide when <em>it</em> should stop.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a77d2b708e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/2026-when-work-looks-finished-before-it-feels-finished-4a77d2b708e5">2026 — When Work Looks Finished Before It Feels Finished</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph of Thoughts: Enhancing Reasoning with Explicit Relational Structures]]></title>
            <link>https://medium.com/towards-nesy/graph-of-thoughts-enhancing-reasoning-with-explicit-relational-structures-985f82da135f?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/985f82da135f</guid>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[reasoning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Jesse Jing]]></dc:creator>
            <pubDate>Sat, 11 Nov 2023 12:00:00 GMT</pubDate>
            <atom:updated>2023-11-11T12:00:00.188Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>In this blog, I present a preprint paper by researchers from Shanghai Jiao Tong University titled “<a href="https://arxiv.org/pdf/2305.16582.pdf">Beyond Chain-of-Thought: Effective Graph-of-Thought Reasoning in Large Language Models.</a>” This paper represents a notable advancement beyond chain-of-thought prompting, an automated process that reframes questions and breaks them down into smaller steps. Unlike the step-by-step approach, the paper introduces an intermediate graph of information generation, utilizing a graph neural network to incorporate an additional modality of relational information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-7sFPa6SBNUNSuJAmEUtQ.png" /><figcaption>Figure 2 from <a href="https://arxiv.org/pdf/2305.16582.pdf">https://arxiv.org/pdf/2305.16582.pdf</a></figcaption></figure><h4>Main Idea</h4><p>The main workflow, depicted in Figure 2 from <a href="https://arxiv.org/pdf/2305.16582.pdf">https://arxiv.org/pdf/2305.16582.pdf</a>, is self-explanatory. The model follows two stages for answering questions: in the first stage, it generates rationales for related problems, and in the second stage, it answers the question. Additionally, the authors introduce the Graph-of-Thought constructor on top of the two major modalities — text and optional image — to obtain an intermediate graph fed into a Graph Neural Network (GNN).</p><p>The inclusion of the graph modality aims to mimic basic deduction processes, such as when A → B and B → C, leading to A → C. Remarkably, the testing results show outstanding performance.</p><h4>Performance</h4><p>On a challenging math dataset (test modality only), the proposed model, with a larger parameter size, outperformed GPT3.5/3. While it falls 10% lower in accuracy compared to GPT4, the latter is a complex system that might involve the adoption of mathematical APIs in the backend. (IMO almost a unfair comparison)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2ScmxkZuWDLAHgxZxvrYQ.png" /></figure><p>For the ScienceQA dataset, which incorporates both text and image modalities, the large version of GoT-T5 achieved state-of-the-art performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uG08KDgA1Fl8LTENE0HlIA.png" /></figure><h4>Notes at the end</h4><p>The relational structure extracted from the rationales makes it easier for the pipeline to grasp essential information from the entire set of related data. In both stages of the process, the Large Language Model (LLM) serves more as an interpreter than a reasoner, alleviating the responsibility of the LLM to conduct multi-step reasonings. Instead, the adoption of the graph of thoughts transforms the process into a “flat” structure.</p><h4>Reference</h4><p><a href="https://arxiv.org/abs/2305.16582">https://arxiv.org/abs/2305.16582</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=985f82da135f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/graph-of-thoughts-enhancing-reasoning-with-explicit-relational-structures-985f82da135f">Graph of Thoughts: Enhancing Reasoning with Explicit Relational Structures</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Temporal Logic Model Checking]]></title>
            <link>https://medium.com/towards-nesy/temporal-logic-model-checking-cf05fc917688?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/cf05fc917688</guid>
            <category><![CDATA[logic]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[formal-verification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jesse Jing]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 01:47:45 GMT</pubDate>
            <atom:updated>2023-08-22T01:44:42.325Z</atom:updated>
            <content:encoded><![CDATA[<h4>Illustrated with a toy example of traffic light</h4><h3>Introduction</h3><p>In light of recent advancements in deep neural networks, which have predominantly dominated fields like Natural Language Processing and Computer Vision, it’s important to recognize that these networks often fall short of being truly robust systems. A notable instance of this is highlighted in the paper titled “<a href="https://proceedings.neurips.cc/paper/2020/hash/a7da6ba0505a41b98bd85907244c4c30-Abstract.html">STLnet: Signal Temporal Logic Enforced Multivariate Recurrent Neural Networks</a>.” In this paper, the authors strive to impose a series of constraints on sequentially generated data. To achieve this objective, the initial step involves verifying whether the generated sequential data adheres to these constraints or if violations occur. This brings us to the focal point of this blog: an exploration of the concept known as model checking. This involves adopting a temporal logic language for specification purposes. To illustrate this concept, a tangible example involving a malfunctioning traffic light is presented.</p><p>Code can be found at the end of this article.</p><p>Examples and descriptions are partially taken from slide <a href="https://www.cs.cmu.edu/~emc/15-398/lectures/overview.pdf">1</a>&amp;<a href="http://www.cds.caltech.edu/~murray/courses/afrl-sp12/L3_ltl-24Apr12.pdf">2</a> by Edmund M. Clarke, Jr. at CMU and Richard M. Murray etc, at CalTech.</p><h3>Basics for Model Checking</h3><ul><li>System: a finite-state transition graph</li><li>Specification: system constraints written in temporal logic rules.</li><li>Model Checking: a search procedure to check if the system is a model for the specification. In other words, it is a process that traverses the transition graph thoroughly to see if any part of the graph violates the system constraints.</li></ul><h3>Linear Temporal Logic</h3><ul><li>A mathamatical language to specify system constraints.</li><li>Each moment in time has a well-defined successor moment in LTL.</li><li>LTL formulas:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Cr4VjOUlZszj552SQZBdQ.png" /><figcaption>This one-liner is usually seen in logic literature where researchers use one line to include all possible allowed formulas in the syntax. “|” stands for OR.</figcaption></figure><p>Operator precedence: Unary operators first, binary operators second. Among binary operators: \cup first, \land, \lor, \rightarrow second. Note that, although \lor, \rightarrow are not in the formulas one-liner, \lor, \rightarrow can be expressed using \land, \neg.</p><p>Path $\sigma$ is a sequence of states sampled from the transition graph. Given a system constraint expressed using LTL formula $\phi$, if path $\sigma$ does not violate the constraint, we say that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/116/1*FmeovVHQT9-LamSQfpnTPg.png" /></figure><p>Two important general temporal operators:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*JVq6Eli8brbIxpGg_6jzKA.png" /><figcaption>Diamond and Square operators are widely seen in temporal logic literature. Although these two operators are not specified in the one-liner syntax formula, they can be easily expressed using the allowed operators like shown in this figure.</figcaption></figure><ul><li>Some common composite operators (from <a href="http://www.cds.caltech.edu/~murray/courses/afrl-sp12/L3_ltl-24Apr12.pdf">slides</a>):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*S-xNstHHbL45uKExyxAx4Q.png" /></figure><h3>Traffic Light Toy Example</h3><p>We have a malfunctioned traffic light defined by a probabilistic transition graph expressed as a dictionary. We have a set of constraints written in LTL formulas. Sample the transition graph for a predefined period of time and see if the system models the specification, if not, output the counter example.</p><h4>Specifications in LTL formulas</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*-BCpSiNJ0AqRitdkwJvOIg.png" /></figure><h4>Code</h4><p>Can access github repo for more: <a href="https://github.com/jink1994/temporal_model_checking">https://github.com/jink1994/temporal_model_checking</a></p><p>The main logic in this code is:</p><ol><li>Create a probabilistic transition graph that imitate a “malfunctioned” traffic light.</li><li>Have one decision function that judge whether a particular pair of states obeys all the LTL formulas.</li><li>Similate for a given time steps.</li></ol><pre>import random<br><br># Define the states of the system<br>GREEN = &#39;green&#39;<br>YELLOW = &#39;yellow&#39;<br>RED = &#39;red&#39;<br><br># Define the decision function based on LTL formulas<br># If any input 2-tuple violates the specification, the function output False<br>def hold_properties(current_state, next_state):<br>    if current_state == RED:<br>        return next_state == GREEN<br>    if current_state == GREEN:<br>        return next_state == YELLOW<br>    if current_state == YELLOW:<br>        return next_state == RED<br><br># Define the probabilistic state transitions<br>transition_probabilities = {<br>  #Green light has a 20% chance of jumping directly into Red by definition<br>    GREEN: dict({YELLOW: 0.8, RED: 0.2}),<br>    YELLOW: dict({RED:1.0}),<br>    RED: dict({GREEN:1.0})<br>}<br><br># Perform probabilistic state transition<br>def transition(current_state):<br>    next_state = random.choices(<br>        population=list(transition_probabilities[current_state].keys()),<br>        weights=list(transition_probabilities[current_state].values()),<br>        k=1<br>    )[0]<br>    return next_state<br><br># Simulate state transitions<br>def simulate(num_steps):<br>    current_state = RED<br>    print(&quot;Starting in state:&quot;, current_state)<br><br>    for step in range(num_steps):<br>        next_state = transition(current_state)<br>        print(&quot;Step {}: Transition from {} to {}&quot;.format(step + 1, current_state, next_state))<br>        if not hold_properties(current_state, next_state):<br>            print(&quot;Temporal property violated.&quot;)<br>            print(f&quot;Counterexample: {current_state} -&gt; {next_state} (Violation)&quot;)<br>            break<br>        current_state = next_state<br><br># Set the number of simulation steps<br>num_simulation_steps = 100<br><br># Perform the simulation<br>simulate(num_simulation_steps)</pre><h4>One Simulation result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*uiyNrKrcr__neDzXdPFasA.png" /></figure><h3>Reference</h3><ul><li><a href="https://proceedings.neurips.cc/paper/2020/hash/a7da6ba0505a41b98bd85907244c4c30-Abstract.html">https://proceedings.neurips.cc/paper/2020/hash/a7da6ba0505a41b98bd85907244c4c30-Abstract.html</a></li><li><a href="http://www.cds.caltech.edu/~murray/courses/afrl-sp12/L3_ltl-24Apr12.pdf">http://www.cds.caltech.edu/~murray/courses/afrl-sp12/L3_ltl-24Apr12.pdf</a></li><li><a href="https://www.cs.cmu.edu/~emc/15-398/lectures/overview.pdf">https://www.cs.cmu.edu/~emc/15-398/lectures/overview.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf05fc917688" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/temporal-logic-model-checking-cf05fc917688">Temporal Logic Model Checking</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Knowledge?]]></title>
            <link>https://medium.com/towards-nesy/what-is-knowledge-7dbd1dbdb39e?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/7dbd1dbdb39e</guid>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[epistemology]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Jesse Jing]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 11:18:18 GMT</pubDate>
            <atom:updated>2023-04-21T11:18:18.559Z</atom:updated>
            <content:encoded><![CDATA[<h4>from Epistemology, AI, and Neuroscience perspectives</h4><h3>Introduction</h3><p>Knowledge is a concept that has been explored and defined in various fields of study, including philosophy, deep learning, and neuroscience. In this blog post, we will delve into the definition of knowledge in each of these three areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Na1EPwcgVs7-tSy7AkXOeA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@giamboscaro?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Giammarco Boscaro</a> on <a href="https://unsplash.com/photos/zeH-ljawHtg?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Knowledge in Epistemology</h3><h4>Justified True Belief</h4><p>In philosophy, knowledge is generally defined as justified true belief. This means that in order for something to be considered knowledge, it must be believed to be true, it must actually be true, and there must be a good reason or justification for believing that it is true. Philosophers have debated and refined this definition for centuries, and there are many different perspectives on what constitutes justification and truth.</p><h4>Gettier Problem?</h4><p>A majority of discussion in this respect is shaped around a tricky problem called the Gettier problem. Researchers from epistemology argue that sometimes you can never claim that the justification process can really eliminate the situation where your belief is just a lucky guess. For example, imagine that you believe your friend Bob is in town because you saw someone who looks like Bob walking down the street. In reality, Bob is in town, but the person you saw was actually his doppelganger. In this case, you believe something that is true, but your justification for that belief is flawed.</p><p>One possible solution to the Gettier problem is to add a fourth condition to the definition of knowledge. This fourth condition, called the “no-false-grounds” condition, states that in order for a belief to count as knowledge, there must be no false grounds for the belief. This means that if there is any possibility that your belief could be false, even if it happens to be true in this particular instance, it cannot be considered knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBt4isqGIuzehVgVbMlV8w.png" /><figcaption>From <a href="http://koreascience.or.kr/article/JAKO202003659137879.pdf">http://koreascience.or.kr/article/JAKO202003659137879.pdf</a></figcaption></figure><h4>JTB+X</h4><p>In addition to the proposed solution of adding a fourth condition to the definition of knowledge, called the “no-false-grounds” condition, there is also a class of remedies known as JTB+X. This approach involves adding a stricter definition or constraint to the justification condition in order to rule out the possibility of taking merely lucky guesses on the Gettier problem. Some examples of such constraints include the requirement that the justification must be based on an inference that is itself known to be true, or the requirement that the justification must be based on a reliable method or source of information. While these remedies have been proposed and debated by philosophers, there is no consensus on which approach is most effective in resolving the Gettier problem.</p><p>In her 1994 paper “The Inescapability of Gettier Problems,” Linda Zagzebski argued that it is always possible to construct a Gettier case that tricks one’s justification process into the “lucky guess” category. She suggested a two-step process for constructing such a case:</p><ol><li>Start with an example of a case where a subject has a justified false belief that also meets condition X;</li><li>Modify the case so that the belief is true merely by luck. Zagzebski’s argument highlights the difficulty of defining knowledge in a way that is immune to Gettier-style counterexamples.</li></ol><h4>Virtue Theoretic Method</h4><p>The virtue-theoretic approach in epistemology is a way of understanding knowledge and justification in terms of intellectual virtues, which are intellectual qualities or dispositions that contribute to acquiring knowledge and forming justified beliefs.</p><p>According to this approach, knowledge and justification are not simply a matter of having true beliefs or reliable methods of belief formation, but also depend on the exercise of intellectual virtues such as honesty, open-mindedness, intellectual humility, attentiveness, thoroughness, and intellectual courage.</p><p>Proponents of this approach argue that an individual’s epistemic status is not determined solely by the content of their beliefs, but also by the way they acquired those beliefs and the character traits they exhibit in the process.</p><p>Virtue epistemology emphasizes the importance of intellectual character and moral virtues for knowledge and justification, and encourages individuals to cultivate these virtues in order to become better knowers and to form beliefs that are more likely to be true and justified.</p><h4>AAA: knowledge as apt belief</h4><p>The “Accuracy, Adroitness, Aptness” (AAA) approach, proposed by Ernest Sosa, is a virtue-theoretic method for analyzing knowledge. According to this approach, knowledge can be understood in terms of three conditions: accuracy, adroitness, and aptness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a15Mc8D9sUYYwHuaZAG5oA.png" /><figcaption>Archer example from <a href="https://slideplayer.com/slide/14377168/">https://slideplayer.com/slide/14377168/</a></figcaption></figure><p>The accuracy condition is similar to the truth condition in JTB analysis, in that it requires that a belief be true in order to count as knowledge. However, the AAA approach emphasizes the importance of the process by which the belief was formed, rather than simply the content of the belief.</p><p>The adroitness condition is concerned with the skill or competence of the knower. It requires that the belief be formed in a way that is indicative of the knower’s skill or competence. This condition is intended to address the problem of lucky guesses in JTB analysis.</p><p>The aptness condition is concerned with the relevance of the belief to the situation at hand. It requires that the belief be appropriately related to the situation in which it is held. This condition is intended to address the problem of irrelevant beliefs in JTB analysis.</p><p>Overall, the AAA approach provides a more nuanced and comprehensive account of knowledge than JTB analysis, by taking into account not only the truth of a belief, but also the process by which it was formed, the skill of the knower, and the relevance of the belief to the situation at hand.</p><h3>Knowledge in Deep Learning</h3><h4>Knowledge as Embeddings</h4><p>In the field of deep learning, knowledge is a bit more narrowly defined. Normally it refers specifically to the information that is learned and stored by artificial intelligence systems as they are trained on large sets of data. This knowledge can be used to make predictions, recognize patterns, and perform a variety of other tasks.</p><p>To intepret in the language of epistemology, knowledge in deep learning refers to the information used in the justification process that generates beliefs. However, these beliefs don’t necessarily have to be true, as the training data used in deep learning only represents a portion of the real world data. We want the accuracy to be high on the training set, but the justification process, or the deep learning model, is supposed to work on out-of-distribution data, which is the testing dataset. If a model is trained until it reaches 100% accuracy on the training dataset, an industry practitioner would hold a skeptical view of the model. This is because it’s almost certain that the model is overfitting on a limited view of the real world.</p><h4>Regularization?</h4><p>Non-deep learning experts might wonder how it is possible to train models with imperfect data and still expect them to perform well on out-of-distribution, real-world data. In practice, deep learning researchers have come up with a set of assumptions that work well. The most famous assumption is based on Occam’s razor: a less complex model is better than a more complex one. This idea leads to a collection of regularization techniques in deep learning, including dropout, l_n regularization, and sparsity as regularization.</p><p>Respectively,</p><ol><li>In dropout, nodes are randomly turned off during training, which helps the model learn to rely on multiple features rather than a single one. This is usually done during the learning process, and during inference time, the dropout is turned off. However, in some applications such as speech synthesis, researchers have found that using dropout during inference time can significantly improve the resulting audio quality.</li><li>L_n regularization adds a penalty term to the loss function that encourages the weights to be small, which can help prevent overfitting.</li><li>Sparsity as regularization is a technique that encourages the model to learn sparse representations, which are more interpretable and generalize better to new data. These regularization techniques help mitigate the problem of overfitting and improve the generalization performance of deep learning models.</li></ol><h4>Common Inductive Bias in DL</h4><p>Other than the simple assumption that less is more implied by Occam’s razor, another line of research is to impose different inductive biases on the models. Some of the most famous inductive biases used in deep learning are as follows:</p><ol><li><strong>Spatial bias:</strong> This bias is commonly used in convolutional neural networks (CNNs), which are frequently employed in image and video recognition tasks. Spatial bias refers to the assumption that the inputs are images, and it imposes a bias on the model to learn features that are translation-invariant. This bias helps the model to learn to recognize objects regardless of their position in the image.</li><li><strong>Spectral bias:</strong> This bias is based on the idea that in some cases, the lower frequencies in the data contain the most important information. Spectral bias is used to prioritize the learning of lower frequencies first in the training process. This approach can help the model to learn simple patterns that generalize well across data samples.</li><li><strong>Structured perception and relational reasoning bias:</strong> This bias introduces structured perception and relational reasoning into deep reinforcement learning architectures. By leveraging this bias, reinforcement learning agents can learn interpretable representations and exceed baseline agents in terms of sample complexity, ability to generalize, and overall performance. This bias can be especially useful in meeting some of the most challenging test environments in modern artificial intelligence.</li><li><strong>Invariance and equivariance bias:</strong> This bias can be used to encode the structure of the relational data. Invariance and equivariance bias notify the behavior of a model under various transformations, which can help the model to generalize better to new data. Equivariant models have been successfully used for various deep learning tasks on data with various structures, such as translation-equivariant images, geometric settings, and discrete objects such as sets and graphs.</li></ol><p>Note that this blog post does not aim to provide a detailed guide on how to build better deep learning models. Instead, it highlights that deep learning models are not just large and complex, and that researchers impose a set of meta-properties on the learning, or searching in a complex space of high dimensions, process to reduce complexity. As Dr. Richard Sutton said, “We want AI agents that can discover like we can, not which contain what we have discovered.”</p><p>While there have been significant advancements in AI, it is important to note that these advancements are still within a scope of a JTB analysis. In this analysis, computational models parse sensory data and generate predictions as beliefs. Although we may incorporate human knowledge to design inductive biases that can help us build a more reliable justification process, we still evaluate models based solely on testing data, which does not account for the possibility of lucky guesses.</p><h3>Knowledge in NeuroScience</h3><p>In the realm of neuroscience, knowledge is intimately tied to the workings of the brain. It is believed to arise from the intricate interactions between neurons and the diverse systems of the brain. While much research has been devoted to uncovering the neural mechanisms underlying knowledge, many mysteries remain.</p><blockquote>How is knowledge encoded, stored, and retrieved in the brain?</blockquote><blockquote>How does the brain represent abstract concepts and complex relationships between them?</blockquote><p>These are just a few of the questions that researchers in the field of neuroscience are striving to answer. Unlike philosophical discussions, which often delve into metaphysical questions, neuroscience focuses purely on the physical and biological mechanisms that give rise to cognition and intelligence. Ultimately, a deeper understanding of the neural underpinnings of knowledge could pave the way for groundbreaking advances in fields such as artificial intelligence and cognitive enhancement.</p><h3>All things come together from an AI perspective</h3><p>As we have seen, knowledge is a complex and multifaceted concept that has been studied and defined in various fields of study. But what can the AI field learn from neuroscience and epistemology?</p><p>Let’s conclude this blog post with a set of open questions from both perspectives:</p><p>From the neuroscience side, ongoing discussions about the efficiency of human brains compared to the energy consumption of deep learning models with the same level of performance raise the question of whether we can make deep learning models as efficient in energy consumption as our brains during inference. For the learning process, can we take as little data as a human brain would see for a deep learning model to achieve the same level of performance?</p><p>From the epistemology side, we can ask whether we can evaluate deep learning models based on more reasonable metrics, or whether we can take insights from philosophers to think about what kind of datasets would help models come closer to true knowledge. A far-fetched proposal is: can we automatically generate Gettier-like cases that drive the design of meta-properties as biases used in deep learning models? These are questions that may lead to new approaches and innovations in the field of AI.</p><h3>Reference</h3><ul><li><a href="https://plato.stanford.edu/entries/knowledge-analysis/">https://plato.stanford.edu/entries/knowledge-analysis/</a></li><li><a href="https://www.sciencedirect.com/science/article/pii/S156625352100230X">https://www.sciencedirect.com/science/article/pii/S156625352100230X</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dbd1dbdb39e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/what-is-knowledge-7dbd1dbdb39e">What is Knowledge?</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bitter Lesson]]></title>
            <link>https://medium.com/towards-nesy/the-bitter-lesson-1a1d282ae1b9?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/1a1d282ae1b9</guid>
            <category><![CDATA[neural-symbolic-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[towardsnesy]]></category>
            <dc:creator><![CDATA[Jesse Jing]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 11:17:59 GMT</pubDate>
            <atom:updated>2023-04-12T11:17:59.041Z</atom:updated>
            <content:encoded><![CDATA[<h4>What direction to avoid in the field of neural symbolic AI?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*vdbbcQorEo9Fe9E37LtRgw.jpeg" /><figcaption>from internet</figcaption></figure><h3>Bitter Lesson 1.0</h3><p>In a blog post by Dr. Richard Sutton in 2019, he coined the term “<a href="http://www.incompleteideas.net/IncIdeas/BitterLesson.html">the bitter lesson</a>” to warn against the temptation of relying on human knowledge to design general-purpose agents/models. According to Sutton, a more efficient search and learning algorithm that scales with computation will always win in the long run.</p><p>This perspective is supported by the 70-year history of symbolicist methods losing to connectionist models. Every time researchers have resorted to human knowledge-based solutions, such as expert systems and hand-crafted classifiers, they have failed miserably.</p><p>Based on Dr. Sutton’s words: <strong><em>we need AI agents that can discover like humans, not ones that simply contain what we have already discovered.</em></strong></p><p>This point is especially important for the field of neural symbolic AI. Bringing in old-world AI designs into current neural networks may seem appealing, but it is ultimately irrelevant if it goes against the trend of leveraging computation.</p><h3>Bitter Lesson 2.0?</h3><p><a href="https://karolhausman.github.io/">Karol Hausman</a>, a staff research scientist at Google Brain, has named the robotics version of this problem “the bitter lesson 2.0.” He predicts that the new inevitable trend is to leverage foundation models that are getting better at understanding the human world in a machine-readable form and providing human-like assistance efficiently.</p><p>For the field of neural symbolic AI, this difference could mean life or death. What should we keep in mind to avoid standing in the way of foundation models? Which section of the NeSy methods, an overarching field for now, will survive the marching of these large language models that can already carry out logical reasoning within an acceptable margin?</p><p>I strongly suggest reading Dr. Sutton’s blog to gain a deeper understanding of the bitter lesson. Let us know what you think.</p><h3>Reference</h3><p><a href="http://www.incompleteideas.net/IncIdeas/BitterLesson.html">The Bitter Lesson</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a1d282ae1b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/the-bitter-lesson-1a1d282ae1b9">The Bitter Lesson</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interpretability in Computer Vision]]></title>
            <link>https://medium.com/towards-nesy/interpretability-in-ff23e3be1577?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/ff23e3be1577</guid>
            <category><![CDATA[neural-network-algorithm]]></category>
            <dc:creator><![CDATA[Tianyu Yang]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 02:00:27 GMT</pubDate>
            <atom:updated>2023-03-30T02:00:27.757Z</atom:updated>
            <content:encoded><![CDATA[<h4>Post-hoc VS Built-in methods</h4><p>In this blog, I introduce two main categories of methods that improve the interpretability for classification tasks in the computer vision field. To illustrate the Built-in category, I also give an example of <a href="https://proceedings.neurips.cc/paper_files/paper/2019/file/adf7ee2dcf142b0e11888e72b43fcb75-Paper.pdf">ProtoPNet</a>.</p><h4><strong>Background</strong></h4><p>In the last decade, with the development of deep learning, especially CNNs, the ability to automatically extract high-level abstract features from images has provided an effective solution for computer-aided classification. Deep CNNs such as VGGNet, ResNet, and DenseNet extract image features and perform classification by constructing network structures and convolutional kernels, using different convolutional kernels and network structures to extract features and classify images from different perspectives to achieve better classification results. Although the prediction performance of deep CNNs is much better than traditional learning models, it still has a common drawback: <strong>a lack of interpretability</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*DkZXe5fi2C-3YUXl" /></figure><h4><strong>What’s interpretability?</strong></h4><p>In 2017, Google Brain proposed interpretability: <strong>Interpretation is the process of giving explanations to humans.</strong>[1]</p><p>There are two general methods improving interpretability：</p><ul><li><strong>Post-hoc</strong>: Train a black box model and apply post-hoc interpretability techniques to provide explanations. It means we need to use interpretable methods to understand the designed model and give decision dependencies after model training. Example: LIME (Local Interpretable Model-agnostic Explanation)[2]</li><li><strong>Built-in</strong>: Use models that are intrinsically interpretable and known to be easy for humans to understand. We can clearly understand the model running process and decision mechanism with the model running. Example: <strong>ProtoPNet[3]</strong></li></ul><h4><strong>Details in ProtoPNet</strong></h4><p>ProtoPNet proposes a deep learning method for image recognition that is both accurate and interpretable. The authors introduce a novel deep learning architecture called the “Siamese Neural Network” that is able to compute the similarity between two images by comparing their feature embeddings, which are high-dimensional representations learned by the network. The network is trained to minimize the distance between embeddings of similar images and maximize the distance between embeddings of dissimilar images. During testing, the network can be used to compare an input image to a set of reference images and output the most similar image(s) from the set based on their computed similarity scores. The approach allows for a measure of interpretability in the image recognition process, as the similarity scores provide a quantifiable measure of similarity between images that can be used to explain the network’s predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NfAxIAxvZERqqxGJ" /></figure><p><strong>Architecture</strong></p><ul><li>Convolutional layers: Pass image x into convolutional layers to get features f(x).</li><li>Prototype Layer: Compute the similarity score between each prototype and each image patch embedding on f(x). Maxpool the similarity score matrix to a vector.</li><li>FC Layer: aggregate weighted similarity scores from each prototype, and get the classification logits.</li></ul><p><strong>How to calculate the similarity between the Prototype and the feature map?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*cDdajLsgvYgJG-yr" /></figure><p>During training, the network is fed pairs of images and is trained to output a similarity score between them. The similarity score is computed by taking the <strong>Euclidean distance</strong> or cosine similarity between the feature embeddings of the two images. The network is then optimized to minimize the distance between embeddings of similar images and maximize the distance between embeddings of dissimilar images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/0*7p1rdXhFYsBwL10_" /></figure><p><strong>Limitation</strong></p><p>The paper primarily focuses on demonstrating the effectiveness of the proposed method on a small dataset, but does not provide extensive examples of real-world applications or use cases for the model.</p><h4><strong><em>Reference</em></strong></h4><p><em>[1]B. Kim, Google Brain, Interpretable Machine Learning (ICML 2017)</em></p><p><em>[2]Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. “ why should I trust you?” explaining the predictions of any classifier (22nd ACM SIGKDD)</em></p><p><em>[3] Chaofan Chen, Oscar Li, Daniel Tao, Alina Barnett, Cynthia Rudin, and Jonathan K Su. This looks like that: deep learning for interpretable image recognition. Advances in neural information processing systems, 32, 2019</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff23e3be1577" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/interpretability-in-ff23e3be1577">Interpretability in Computer Vision</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State-wise Safe Reinforcement Learning: A Survey]]></title>
            <link>https://medium.com/towards-nesy/state-wise-safe-reinforcement-learning-a-survey-f34a729c5427?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/f34a729c5427</guid>
            <category><![CDATA[neural-symbolic]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[saferl]]></category>
            <dc:creator><![CDATA[Weiye Zhao]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 20:13:17 GMT</pubDate>
            <atom:updated>2023-04-15T03:35:32.218Z</atom:updated>
            <content:encoded><![CDATA[<h4>Two classes, existing methods, and some trade-offs</h4><p>In this blog, we would like to share an interesting survey paper that discusses the recent advances in the field of safe reinforcement learning. Although RL demonstrates its impressive performance in many continuous control tasks, one of the major blocks for applying RL to real-world applications is how to provide RL with a state-wise safety guarantee. Enforcing state-wise constraints is necessary and essential to many challenging tasks such as autonomous driving and robot manipulation. This blog will summarize the existing state-wise safe RL works.</p><p>If you’re interested in a detailed survey, please check <a href="https://arxiv.org/abs/2302.03122">this</a> out directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fz0mQdl0dTMMxOryfOh-uA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@lennykuhne?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Lenny Kuhne</a> on <a href="https://unsplash.com/photos/jHZ70nRk7Ns?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><h4>State-wise safe RL?</h4><p>Reinforcement learning (RL) has made impressive strides in games and control tasks, but the lack of safety assurance is a major obstacle to its application in real-world scenarios. RL agents prioritize maximizing reward over ensuring safety, which can lead to unsafe or even catastrophic outcomes. Safe RL approaches have emerged to provide safety guarantees during or after training, but early attempts have mainly focused on cumulative or probabilistic constraints. However, many critical constraints in real-world applications are instantaneous and deterministic, depending only on the current state of the system. State-wise safe RL is therefore a challenging but crucial step toward applying RL to real-world scenarios. The RL community should pay more attention and effort to state-wise safe RL.</p><h4>Math Formulation</h4><p>Then we can dive into the more mathematical formulation of this problem. I will try to simplify the explanation and avoid overly abused equations. We will discuss three parts:</p><ol><li>What is Markov Decision Process (MDP)?</li><li>What is Constrained Markov Decision Process (CMDP)?</li><li>What is State-wise Constrained Markov Decision Process (SCMDP)?</li></ol><p><strong>Markov Decision Process (MDP) </strong>is a mathematical framework used to model decision-making problems where outcomes are partly random and partly under the control of a decision-maker. In an MDP, an agent makes decisions in a sequence of states, where each state represents a situation in which the agent can take a specific action. The result of an action in a state is determined by a probability distribution, and the agent receives a reward based on the outcome. The key assumption of an MDP is the Markov property, which states that the probability distribution of the next state and reward depends only on the current state and action, and not on the past history of the process. MDPs can be used to solve various decision-making problems, such as robotic control, finance, and healthcare. The goal of an MDP is to find a policy, which is a mapping from states to actions that maximizes the expected sum of rewards over time. Here is an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjH92BHrOEbyQjC4iOQc8A.png" /><figcaption>Here I assume readers have a basic knowledge of RL, such that discount factor, reward function, state action transition pairs, etc.</figcaption></figure><p><strong>Constrained Markov Decision Process (CMDP) </strong>is a variant of the standard Markov Decision Process (MDP) that incorporates constraints into the decision-making problem. In a CMDP, the goal is to find a policy that maximizes the expected sum of rewards subject to a set of constraints. The solution to a CMDP involves finding a policy that maximizes the expected sum of rewards subject to the constraint(s), and this can be done using a variety of methods, such as Lagrangian relaxation, linear programming, or dynamic programming. Following is an example of CMDP objective</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*RuaOnXhfxyLzWDogZC1_TQ.png" /><figcaption>Here $\pi$ means policy, and $\Pi_C$ means the set of policies that satisfy cost constraint.</figcaption></figure><p><strong>State-wise Constrained Markov Decision Process (SCMDP) </strong>is a special type of CMDP, where the allowable policy means that the state-wise safety constraint must be satisfied at every time step. For example, in autonomous driving, the state-wise safety constraint means that the policy should output action such that the vehicle and surrounding obstacles are collision-free at every time step. Mathematically, the feasible SCMDP policy could be expressed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HU2ZAPEzlRXjSSYUpF2_AA.png" /><figcaption>At every time step, every state-wise cost should satisfy a hard constraint.</figcaption></figure><h3>Existing Methods for Solving SCMDP</h3><h4>Two Classes</h4><p>With the mathematical background, we can introduce the representative methods to solve the SCMDP. And exisiting methods can be divided into two categories: (i) achieving state-wise safety after policy convergence (<strong>After Convergence</strong>)<strong>, </strong>(ii) achieving state-wise safety during policy training (<strong>During Training</strong>).</p><p><strong>After Convergence: </strong>it refers to methods that have infeasible policies during training but feasible converged stationary policies in the end. Essentially, it involves using soft penalties, called safe critic Q_c(s,a), to guide the training of policies. The safe critic can be provided by humans or learned from the environment. This approach does not pose hard constraints on the exploration space, which allows for more efficient policy learning, but the policy may still be unsafe during training and convergence to a safe policy may be challenging in some cases. This figure demonstrates the process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*ujJjcTbWSZMJKSVWb3il1w.png" /><figcaption>state-wise safe RL policy after convergence.</figcaption></figure><p><strong>During Training: </strong>this approach is stricter than achieving state-wise safety after convergence because all intermediate policies during training must be feasible. two classes of methods for ensuring state-wise safety during training exist.</p><p><strong>The first class</strong> guarantees safety by projecting policies back into the subset whenever they go outside of it. However, this approach requires a significant amount of prior knowledge about the environment and may be more conservative in exploration, which is illustrated as following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*tIlic-lgFrIu4QLWlSQBNw.png" /><figcaption>Project policies into safe policies set</figcaption></figure><p><strong>The second class </strong>of methods involves progressively exploring the policy space from a safe initial policy and maintaining an up-to-date subset of safe policies set by gathering information. Policy updates are only made if there is enough information to confirm that the updated subset is a subset of the safe policies set. This approach requires less prior knowledge than the first class but is more conservative in exploration. The illustration is demonstrated as following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*lB55AWNG5NwLRtR-U64Pmw.png" /><figcaption>state-wise safe policy via progressive safe exploration</figcaption></figure><p>Next, I will introduce one representative method for each category.</p><h4><strong>State-wise Safety After Convergence</strong></h4><p>One typical approach is to use a hierarchical policy for ensuring state-wise safety constraints. The upper layer of the policy is a reinforcement learning policy, while the lower layer is a safety monitor that filters actions to ensure the policy satisfies the safety constraints. To do this, the paragraph proposes a safe critic $Q_C(s,a)$ that estimates the chance of future safety violations. <a href="https://arxiv.org/abs/2010.14497">Conservative Safety Critics (CSC)</a> is then introduced as an optimization algorithm that trains both $Q_C$ and the policy to provide a conservative estimate of the likelihood of being unsafe given a state-action pair. If the safety violation exceeds the predefined safety violation threshold, new actions will be re-sampled from the policy until the safety critic agrees the proposed action is safe. Mathematically,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*hmgkbSxCgsMJ843uVpIbxQ.png" /></figure><p>As the policy convergence, the safety critic will be trained pretty well, so that the state-wise safety is guaranteed as long as we sample a critic agreeable action.</p><h4><strong>State-wise Safety During Training (Projection)</strong></h4><p>Although seem similar to the approach we introduced in the previous section, <strong>During Training</strong> approaches satisfy state-wise safety constraints via correcting actions at each step by projecting them onto a feasible action set such that the cost constraints are satisfied. This approach involves constructing a hierarchical safe agent with an upper layer that generates reference actions and a lower layer that performs the projection. The solution to the problem is also a hierarchical-structured policy, with the difference that</p><blockquote>The lower layer in this approach usually has prior knowledge about the cost function via system dynamics assumption and is therefore more capable of providing state-wise safety guarantee during policy training compared to the hierarchical policy discussed in a previous section.</blockquote><p>One good approach is called <a href="https://openreview.net/pdf?id=UGp6FDaxB0f">Implicit Safe Set Algorithm (ISSA)</a>, which is a hierarchical-structured safe policy that consists of an upper layer and a lower layer. The upper layer uses the PPO algorithm to generate task-oriented reference actions, while the lower layer filters out unsafe control actions by projecting them to a set of safe control. The policy is constructed using an energy function safety index, which ensures that state-wise safe policy corresponds to all policies that make safety index non-positive for all time steps. ISSA does not require explicit knowledge of system dynamics, only the kinematic limits, which makes it scalable. To ensure state-wise safety guarantee with a black-box dynamics model, ISSA solves safe control at every time step via a constrained optimization problem, which is solved via multi-directional line search. However, the line search requires a one-step simulation through a digital twin simulator, which is a pretty strong assumption.</p><h4><strong>State-wise Safety During Training (Progressive)</strong></h4><p>It is possible to construct state-wise safe reinforcement learning agents without prior knowledge of the environment. <a href="https://arxiv.org/pdf/1705.08551.pdf">One representative method proposed by Berkenkamp</a>, which learns a single policy that generates actions with high-probability safety guarantees at every step during training. This is achieved by defining safe policies that keep the system within a subset of the state space, known as the region of attraction (ROA), and learning the unknown system dynamics through Gaussian process modeling. The algorithm iteratively updates the policy and the dynamics model, while taking safe actions only. The policy optimization with ROA estimation is formulated as an optimization problem that maximizes the size of the ROA while ensuring that the policy reduces the Lyapunov energy function within the ROA. This approach achieves full exploration within reachable parts of the state space and is proven to work on an inverted pendulum simulation without letting the pendulum fall. However, the method has some drawbacks, including the difficulty of obtaining a proper Lyapunov function for defining the ROA and the possibility of non-stationary system dynamics.</p><h3>Some End Notes on Trade-offs</h3><p>So far we have introduced three different categories of methods that can solve state-wise safe reinforcement learning, and we are now ready to give some conclusions about the trade-offs of the current methods. There are two major trade-offs</p><p><strong>The first trade-off is between guarantee and scalability</strong>, where strong assumptions can lead to solid safety guarantees for limited systems, but weaker assumptions can make it harder to derive theory from complicated dynamics. However, weaker assumptions lead to better scalability for different dynamics systems.</p><p><strong>The second trade-off is between asymptotic and in-training safety</strong>, where asymptotic safety is desired when the agent’s actions have a low probability of causing harm in the early stages of training, but the risk increases as the agent becomes more proficient. Strict safety from the beginning of training can be more difficult to implement, as it often requires prior knowledge about the environment or task. The best approach depends on the application and level of safety required.</p><h3><strong>About author</strong></h3><p><a href="https://scholar.google.com/citations?user=P-79KOcAAAAJ&amp;hl=en"><strong>Weiye Zhao</strong></a> is a fourth-year Ph.D. candidate at the Robotics Institute of Carnegie Mellon University, with a primary research focus on providing provable safety guarantees for robots. Specifically, he is interested in constrained reinforcement learning, nonconvex optimization, and safe control. He has published in numerous renowned venues, including ACC, CDC, AAAI, CoRL, L4DC, RCIM, LCSS, and others. Additionally, he serves on the program committee for several conferences, including IV, AAAI, CoRL, CDC, ACC, L4DC, and more.</p><h3>Reference</h3><p><a href="https://arxiv.org/abs/2302.03122">State-wise Safe Reinforcement Learning: A Survey</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f34a729c5427" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/state-wise-safe-reinforcement-learning-a-survey-f34a729c5427">State-wise Safe Reinforcement Learning: A Survey</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards a Fair Classifier]]></title>
            <link>https://medium.com/towards-nesy/eliminating-discrimination-patterns-in-a-naive-bayes-classifier-3fa5fdeaac2b?source=rss----f37f46392a6e---4</link>
            <guid isPermaLink="false">https://medium.com/p/3fa5fdeaac2b</guid>
            <category><![CDATA[probabilistic-learning]]></category>
            <category><![CDATA[discrimination-patterns]]></category>
            <category><![CDATA[fair-ml]]></category>
            <category><![CDATA[fairness-and-bias]]></category>
            <dc:creator><![CDATA[Harshit Pandey]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 20:20:28 GMT</pubDate>
            <atom:updated>2023-03-16T20:20:28.234Z</atom:updated>
            <content:encoded><![CDATA[<h4>Eliminating Discrimination Patterns in a Naive-Bayes Classifier</h4><p>This blog introduces the paper: Learning Fair Naive Bayes Classifiers by Discovering and Eliminating Discrimination Patterns, AAAI 2020. Feel free to check it out directly <a href="https://arxiv.org/pdf/1906.03843.pdf">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*nWsq-sGcvsZ97vAMY2SoCQ.jpeg" /><figcaption>Photo by Getty Images</figcaption></figure><h3>Introduction</h3><h4>Why is fairness cruicial to ML tools?</h4><p>With the increasing involvement of Machine Learning and AI in our day to day lives, comes the big task of understanding the bias and discrimination that seep into these models through data. To cite a few, racial bias in policing (<a href="https://scholarworks.iupui.edu/bitstream/handle/1805/18253/Mohler_2018_Penalized.pdf?sequence=1">Mohler et al. 2018</a>), recidivism prediction (<a href="https://arxiv.org/pdf/1610.07524.pdf">Chouldechova 2017</a>), gender bias in hiring (<a href="https://arxiv.org/pdf/1806.01059.pdf">Lahoti et al. 2018</a>), and credit rating (<a href="https://journals.sagepub.com/doi/10.1007/s12114-015-9215-4">Henderson et al. 2015</a>). The list is endless and is rapidly growing as we continue to integrate AI into more decision making avenues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*5BS6KXrTomJOr1oIlcCqvA.png" /><figcaption>Fig1: The bias in Northpoints’s tool for recidivism. (from <a href="https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing">Larson et al. ProPublica, 2016</a>)</figcaption></figure><p>Fairness literature has come up with several solutions to limit differential treatment of similar individuals and quantify a classifier’s dicriminatory nature through statistical measures. Some of the prominent approaches include,</p><ul><li>Individual fairness (<a href="https://arxiv.org/pdf/1104.3913.pdf">Dwork et al. 2012</a>; <a href="http://proceedings.mlr.press/v28/zemel13.pdf">Zemel et al. 2013</a>)</li><li>Disparate Impact and Group Fairness (<a href="https://arxiv.org/pdf/1412.3756.pdf">Feldman et al. 2015</a>; <a href="https://arxiv.org/pdf/1610.07524.pdf">Chouldechova 2017</a>)</li><li>Counterfactual fairness (<a href="https://proceedings.neurips.cc/paper/2017/file/a486cd07e4ac3d270571622f4f316ec5-Paper.pdf">Kusner et al. 2017</a>)</li><li>Relational fairness (<a href="https://dl.acm.org/doi/10.1145/3278721.3278733">Farnadi, Babaki, and Getoor 2018</a>)</li><li>Equality of opportunity (<a href="https://arxiv.org/pdf/1610.02413.pdf">Hardt et al. 2016</a>)</li></ul><p>Most of the explored approaches assume that all feature values are present at prediction time (complete assignment), which is seldom true in a real world scenarios. <strong>Such an assumption could miss several instances of biased behaviour</strong> that are observed with partial assignment of variables and thus can leave gaps while evaluating models for bias and fairness.</p><p>This is the sweet spot where <strong><em>Discrimination Patterns (</em></strong><a href="https://arxiv.org/pdf/1906.03843.pdf"><strong><em>Choi et al.</em></strong></a><strong><em>) </em></strong>comes in. It introduces a new notion of fairness which asks whether the model shows patterns where the decision label for an individual, characterized by (partial) feature observations, changes significantly when one or more sensitive attributes are disclosed.</p><h4>What are Discrimination Patterns?</h4><blockquote><em>Assuming </em><strong>d</strong><em> being a decision variable, </em><strong>x</strong><em> be an assignment from sensitive attributes and </em><strong>y</strong><em> represents attribute assignment for similar individuals from a group, the </em><strong>Degree of Discrimination of pattern (xy)</strong><em> is defined as :</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47-yYxhlKG-dPyPHYYv37Q.png" /></figure><blockquote><em>The joint assignment of (x,y) forms a Discrimination pattern if <br></em><strong><em>|ΔP,d(x, y)| &gt; δ</em></strong><em>, where δ is a chosen fairness threshold.</em></blockquote><p>For more details on Discrimination Pattern, please read my previous blog<br><a href="https://medium.com/@harshitebpandey/discrimination-patterns-a-fine-grained-notion-to-quantify-fairness-35c54fe9889c">Discrimination Patterns — A fine-grained notion to quantify fairness</a>.</p><h3>Main Idea</h3><h4>Finding Discrimination Patterns in a Probabilistic Clasiifier</h4><p>Although the notion of <em>δ-</em>fairness can be applied to any distribution, discovering all discrimination patterns is a hard problem as a given distribution can have exponentially many discrimination patterns.</p><p>Naive-Bayes Classifiers, with their strong independence assumption, allow for a tractable algorithm to discover and eliminate discrimination patterns.</p><p>First method to find all discrimination patterns is to naively traverse all possible patterns and check if they form a discrimination pattern. This is still an exponential complexity task and thus we use a <em>Branch and Bound </em>technique to converge the search faster.</p><p>An Upper Bound function bounds the degree of discrimination achievable by observing more features after xy while excluding features E, is used to implement the branch and bound search. <a href="https://doi.org/10.1609/aaai.v34i06.6565"><strong>Choi et al.</strong></a> discusses a linear time algorithm to find upper bound for given x,y.</p><h4>How important is a particular discrimination pattern?</h4><p>Although all discrimination patterns are worth paying attention to, but the ones that have higher presence in the dataset need to be given higher priority as they are more likely to be observed in test scenario. To achive this we rank the Discrimination patterns using the <strong><em>Divergence Score, </em></strong>the minimum Kullback-Leibler divergence between current distribution hypothetical distribution Q that is fair on the pattern xy and differs from P only on the assignments that satisfy the pattern (namely d,xy and notd,xy).</p><p>Formally —</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FmtZEHMwShkdLxAeM1ipkcf&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FmtZEHMwShkdLxAeM1ipkcf&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="408" height="188" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab729db03d1418c6d28adaacfff4c5bc/href">https://medium.com/media/ab729db03d1418c6d28adaacfff4c5bc/href</a></iframe><p><strong>Parameter learning for a fair classifier</strong><br>Using this ranked set of Discrimination Patterns, we find the top-k patterns which are then used during the parameter learning phase of the classifier to eliminate the high-risk dicrimination patterns. An algorithm for constrained parameter learning has been discussed in <a href="https://arxiv.org/pdf/1903.01620.pdf"><strong>Khosravi et al. 2019</strong></a>.</p><p>Using the discussed algorithm, it can be shown that |ΔPθ,d(x,y)| ≤ δ for a threshold δ ∈ [0, 1] iff the following holds :</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FczjS8dfx4UmSkfYQsvYcb9&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FczjS8dfx4UmSkfYQsvYcb9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="337" height="259" frameborder="0" scrolling="no"><a href="https://medium.com/media/94ba27e0fc465d2178f25f29eee66f62/href">https://medium.com/media/94ba27e0fc465d2178f25f29eee66f62/href</a></iframe><p>The main theme of the algorithm is to <strong>iterate between parameter learning and constraint extraction</strong>, where constraints are derived from the top-k discrimination patterns at that iteration.</p><p>That is, we iterate between <em>parameter learning </em>and <em>constraint extraction</em>, gradually adding fairness constraints to the optimization. The parameter learning component is as described in the previous section, where we add the constraints for each discrimination pattern that has been extracted so far. For constraint extraction we use the top-k pattern miner. At each iteration, we learn the maximum-likelihood parameters subject to fairness constraints, and find k more patterns using the updated parameters to add to the set of constraints in the next iteration. This process is repeated until the pattern miner finds no more discrimination pattern.</p><p>Although this is an exponential complexity algorithm, it is proven empirically that the search converges in much fewer iterations.</p><p>Results from <a href="https://doi.org/10.1609/aaai.v34i06.6565"><em>Choi et al.</em></a><em> —</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mqk-JE_zkkwao9k4rDZRrQ.png" /><figcaption>Log-likelihood and the number of remaining discrimination patterns after each iteration of learning on COMPAS dataset with δ = 0.1</figcaption></figure><p>While comparing an unconstrained maximum-likelihood model and a model in which the sensitive variables are independent of the decision variable (NB assumption) with the remaining parameters learned using the max-likelihood criterion (independent). We observer that these models lie at two opposite ends of the spectrum of the trade-off between fairness and accuracy. <strong><em>The δ-fair model falls between these extremes, balancing approximate fairness and prediction power.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*LoTljO4qXaJA4HMSYD94ew.png" /><figcaption>Log-likelihood of models learned without fairness constraints, with the δ-fair learner (δ = 0.1), and by making sensitive variables independent from the decision variable.</figcaption></figure><h3>References</h3><p>Choi, Y., Farnadi, G., Babaki, B. and Van den Broeck, G. 2020. Learning Fair Naive Bayes Classifiers by Discovering and Eliminating Discrimination Patterns. <em>Proceedings of the AAAI Conference on Artificial Intelligence</em>. 34, 06 (Apr. 2020), 10077–10084. DOI:https://doi.org/10.1609/aaai.v34i06.6565.</p><p><em>Pasha Khosravi, Yitao Liang, YooJung Choi, and Guy Van Den Broeck. 2019. What to expect of classifiers? reasoning about logistic regression with missing features. In Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI’19). AAAI Press, 2716–2724.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fa5fdeaac2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/towards-nesy/eliminating-discrimination-patterns-in-a-naive-bayes-classifier-3fa5fdeaac2b">Towards a Fair Classifier</a> was originally published in <a href="https://medium.com/towards-nesy">Towards NeSy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>