10 ms·
Translating natural language to first-order logic for logical fallacy detection
- analog31 2y agoDoesn't Goedel's Theorem forbid building a logic checker?
- drdeca 2y agoNo. Gödel’s theorem forbids something that in general tells you whether a statement is true or not. (As in, a method which would work for every possible statement within a system.) It certainly doesn’t preclude something that checks if a proof is correct, any more than it precludes checking whether some calculation is done correctly (I.e. it doesn’t preclude it at all) . It says that there are statements which the proof system doesn’t have a proof of the statement being true nor of it being false. It doesn’t mean you can’t have a proof system.
- bubblyworld 2y agoNot Gödel's theorem, but inference for first-order logic is undecidable in general for other reasons. You can still get pretty far with heuristics though. Don't let perfect be the enemy of good =P
- dpierce9 2y agoFirst order logics can be provably sound and complete when they do not express certain arithmetic operations.
- bubblyworld 2y agoFirst-order logic is sound and complete in general (via Gödel's lesser known completeness theorem, for instance). That doesn't contradict what I wrote =)
- deleted 2y ago[deleted]
- rahimnathwani 2y agoThe paper links the code repo: https://github.com/lovishchopra/NL2FOL https://github.com/lovishchopra/NL2FOL But I don't see a pretrained model in there, so I'm not sure what to pass as `your_nli_model_name`: python3 src/nl_to_fol.py --model_name <your_model_name> --nli_model_name <your_nli_model_name> --run_name <run_name> --dataset --length
- janalsncm 2y agoIf we check the script, it seems to support open ai models and llama https://github.com/lovishchopra/NL2FOL/blob/main/src/nl_to_fol.py https://github.com/lovishchopra/NL2FOL/blob/main/src/nl_to_f... It would have been a lot cooler if this was set up as a pretrained model using RL to translate.
- rahimnathwani 2y agoThat's for --model_name, not --nli_model_name: https://github.com/lovishchopra/NL2FOL/blob/4635a81f216da2ad69c1d36215d6bd88841cc6d8/src/nl_to_fol.py#L459 https://github.com/lovishchopra/NL2FOL/blob/4635a81f216da2ad... nli_tokenizer = AutoTokenizer.from_pretrained(args.nli_model_name) nli_model = AutoModelForSequenceClassification.from_pretrained(args.nli_model_name)
- atilimcetin 2y agoAlthough not sure, it can be related to NLI models described here https://paperswithcode.com/task/natural-language-inference https://paperswithcode.com/task/natural-language-inference
- FloorEgg 2y agoNot familiar with FOL as a formalism, and would love to see this in action. I feel like it's a big part of the solution to propaganda. The other part seems to be values obfuscation, and I wonder if this would help with that too. If Joe says that nails are bad, it can mean very different things if Joe builds houses for a living and prefers screws, or if Joe is anti development and thinks everyone should live in mud huts. Propaganda will often cast a whole narrative that can be logically consistent, but entirely misrepresents a person or people's values (their motivations and the patterns that explain their actions), and there will be logical fallacies at the boundaries of the narrative. We need systems that can detect logical fallacies, as well as value system inconsistencies.
- andrewdb 2y agoA prompt that I like to use for this: --- Intake the following block of text and then formulate it as a steelmanned deductive argument. Use the format of premises and conclusion. After the argument, list possible fallacies in the argument. DO NOT fact check - simply analyze the logic. do not search. After the fallacies list, show the following: 1. Evaluate Argument Strength: Assess the strength of each premise and the overall argument. 2. Provide Counterarguments: Suggest possible counterarguments to the premises and conclusion. 3. Highlight Assumptions: Identify any underlying assumptions that need examination. 4. Suggest Improvements: Recommend ways to strengthen the argument's logical structure. 5. Test with Scenarios: Apply the argument to various scenarios to see how it holds up. 6. Analyze Relevance: Check the relevance and connection between each premise and the conclusion. Format the argument in the following manner: Premise N: Premise N Text ETC Conclusion: Conclusion text [The block of text to evaluate]
- FloorEgg 2y agoNice prompt, I've been doing something similar but not this robust. I'll give this a spin. Thanks again!
- heyitsguay 2y agoHumans aren't rational actors who get tricked into embracing propaganda by subtle logical fallacies. This will be of no more help than fact checking. It's a neat project on its own, tbc, I just have very low expectations of broader impact.
- ColinWright 2y agoIt was Gottfried Leibniz who envisaged the end of philosophic disputes, replacing argument with calculation. "if controversies were to arise, there would be no more need of disputation between two philosophers than between two calculators. For it would suffice for them to take their pencils in their hands and to sit down at the abacus, and say to each other (and if they so wish also to a friend called to help): Let us calculate."
- soulofmischief 2y agoIf only. Ethics are reached via consensus. Two calculators can indeed produce different results if the axioms supporting them differ. And good luck calculating some of these axioms, such as "Why is it my duty not to kill someone?" You could argue, "Well in the end, a society enabling such behavior at scale would be no society at all," to which one might reply, "I have no interest in letting others do as I do.", and you can't calculate away violent sociopaths. The rest of us derive our principles from functioning mammalian emotional circuits, but at some level we rest our case on subjective axioms.
- glenstein 2y ago>Ethics are reached via consensus This is probably too big a topic for a whole side-branch on this, but modern meta-ethics teaches a range of possible approaches. Some notions of ethics are relativist, and are about the fact that moral norms are produced by some given society. But under some constructions that's just a procedural truism rather than a position on the content or the nature of morality itself. Then you have moral realism, a perfectly respected position, which can encompass things like utilitariansim and other ism's. And this might seem silly derail, and I'm trying not to, but this is important at the end of the day, because "ethics is reached via consensus" can mean a lot of things that cash out with completely different practical implications. It's the difference between, for instance, deciding we need to be consensus oriented and vote, or be research oriented and concerned with deepening our scientific understanding of things like insect consciousness and whether the physical effects of sleep deprivation fall under the traditional definition of torture. >And good luck calculating some of these axioms Not wrong, they can easily get computationally intractable. So I think one has to account to some degree for uncertainty. Here again, I worry that the intended upshot is supposed to be that we simply give up or treat the project of moral understanding like a cosmically impossible non-starter. I like to think there's a middle ground between where we presently stand and the hypothetical future where we've got perfect knowledge.
- languagehacker 2y agoIt sounds like the data set they use is designed to teach what logical fallacies are, which makes sense that it would do fine with it. I doubt this would do well against real-world language with things like structural ambiguity, anaphoric resolution, and dubious intent.
- MortyWaves 2y agoTrolls that knowingly engage in bad arguments with flawed logic are going to be in shambles.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- mike_hearn 2y agoLove the idea in theory and would like such a tool to exist, but the use cases they present aren't convincing. This would be useful in much more specific cases like drafting contracts, laws or technical documentation: places where unusually precise language without corner cases is mutually desired by everyone, and the set of fallacies that occur is small and specific. This paper doesn't target such use cases. Instead it's trying to tackle "pop misinformation" type claims, mostly related to climate change. Unfortunately the Logic and LogicClimate datasets that the paper are using as a benchmark have serious problems that should disqualify them from being considered a benchmark. If we check the paper that introduced them, Jin et al open by asserting that "She is the best because she is better than anyone else" is an example of circular reasoning. It's actually a tautology. Then they try again with "Global warming doesn’t exist because the earth is not getting warmer" which is also not circular reasoning, it's another tautological restatement (you may say it's false, but disagreement over facts isn't a disagreement over logic - if either clause is true so is the other). Circular reasoning often involves a mis-definition and would be something like this real-world example from a few years ago: 1. A positive test is means you have COVID. 2. Having COVID is defined as having a positive test. Their second example is "Extreme weather-related deaths in the U.S. have decreased by more than 98% over the last 100 years ... Global warming saves lives" which they classed as "false causality" (they mean non-sequitur). My experience has been that climate skeptics are surprisingly logical so this would be an odd statement for them to make, and indeed if we check the original Washington Times op-ed then we find Jin et al are engaging in malicious quoting. It actually says: > "Contrary to sensational media reports, extreme weather-related deaths in the U.S. have decreased more than 98% over the last 100 years. Twenty times as many people die from cold as from heat, according to a worldwide review of 74 million temperature-related deaths by Dr. Antonio Gasparrini and a team of physicians. Global warming saves lives." The saves lives claim is based on cold being more dangerous than heat. Warmer weather = fewer deaths from cold isn't a logical fallacy, which is why they had to delete that part to make their example. It might sound like a weird or disingenuous argument to you, but it's logical in the sense that an SMT solver would approve of it. If you disagree it's probably due to prior beliefs e.g. that perhaps extreme weather has increased even as society got orders of magnitude better at reducing the impacts, or perhaps the positive effects of warmer air on the elderly are offset by other effects of climate change, or that the future will be different to the past due to compounding effects. Such rebuttals aren't identifications of a logical fallacy though, just of different priors that could maybe be addressed with additional rounds of debate.
- nico 2y agoIs this just another form of the same concept behind smart contracts?
- zozbot234 2y agoI'm pretty sure that the semantics of natural language are a lot more complex than can be accounted for by these seemingly very ad-hoc translations into comparatively straightforward FOL formulas, as are given in this paper. A common approach for the understanding of NL semantics from a strictly formal POV is Montague semantics https://en.wikipedia.org/wiki/Montague_grammar https://en.wikipedia.org/wiki/Montague_grammar https://plato.stanford.edu/entries/montague-semantics/ https://plato.stanford.edu/entries/montague-semantics/ - even a cursory look at these references is enough to clarify the level of complexity that's involved. Very loosely speaking one generally has to work with multiple "modalities" at the same time each of which, when understood from the POV of ordinary FOL, introduces its own separate notion of abstract "possible worlds" (representing, e.g. an agent's set of beliefs) and ways in which these "worlds" can relate to one another. More complex cases will usually degenerate in some sort of very generic "game semantics" https://en.wikipedia.org/wiki/Game_semantics https://en.wikipedia.org/wiki/Game_semantics https://plato.stanford.edu/entries/logic-games/ https://plato.stanford.edu/entries/logic-games/ where any given use of natural language is merely seen as a "game" (in the abstract strategic, game-theoretical sense) with its own set of possibly very ad-hoc 'rules'. The philosopher Ludwig Wittgenstein https://en.wikipedia.org/wiki/Ludwig_Wittgenstein https://en.wikipedia.org/wiki/Ludwig_Wittgenstein https://plato.stanford.edu/entries/wittgenstein/ https://plato.stanford.edu/entries/wittgenstein/ gave quite a good description of both of these approaches (from a very naïve approach based on a supposedly straightforward translation to some kind of abstract logic, to a far richer one based on notions of strategies and games) to a "formal" understanding of natural language, throughout his extensive philosophical inquiry. Which is to say, I'm not sure how this paper's results are generally expected to be all that useful in practice.
- lapcat 2y agoSee also for example V.H. Dudman on the interpretation of "If" sentences: https://www.scribd.com/document/478756656/Dudman-1984-Conditional-Interpretations-of-If-sentences https://www.scribd.com/document/478756656/Dudman-1984-Condit...
- cs702 2y agoIt could be useful for domains in which all or at least many problems are solvable (i.e., they can be stated and satisfied) with first-order logic. It could also be useful as a lower-level component of general-purpose systems that internally rely on chains of thought computed by sub-component LLMs.
- pixelpoet 2y agoOh man, where was this back in the 90s arguing with proto-trolls on IRC and usenet who shamelessly moved goalposts, stawmanned, appealed to authority, resorted to ad hominem, ... Imagine if you could click on a stupid internet discussion thread and make it give you a Lean proof of each argument where possible :D This thing would be hated even more than, say, vaccines, by the same sorts of people who deliberately choose to not understand things.
- shortrounddev2 2y agoI believe this is something Immanuel Kant tried to do in the 18th century
- qgin 2y agoI don't know how much potential this has to solve propaganda / bad faith arguments because you can just say "that logic program is biased" and handwave the entire thing away. But you could imagine a role for this in arbitration or legal settings.
- biggoodwolf 2y ago0 in all three cases
- giardini 2y agoProlog has always had DCGs (Definite Clause Grammars) that allow you to write rules that resemble natural language grammar structures to parse and generate English sentences: https://www.metalevel.at/prolog/dcg https://www.metalevel.at/prolog/dcg
- svnt 2y agoThis is already something that e.g. Claude 3.7 Sonnet appears to be able to do very well, with the added benefit of explaining why if you let it -- what is the benefit of this model?: > "Sometimes flu vaccines don't work; therefore vaccines are useless." - Hasty generalization > "Every time I wash my car, it rains. Me washing my car has a definite effect on the weather." - Post hoc, ergo propter hoc > "Everyone should like coffee: 95% of teachers do!" - Appeal to popularity and hasty generalization > "I don't want to give up my car, so I don't think I can support fighting climate change." - False dilemma
- mannykannot 2y agoIt would take more subtle examples, embedded within what is mostly fallacy-free text, to evaluate the absolute and relative utilities of the two approaches to the problem - or, to put it another way, we should not hastily generalize from their performance on a few straightforwardly fallacious sentences.
- EigenLord 2y agoThis is very cool and definitely a step in the right direction, however, the question remains where exactly this formalizing module should be placed in the stack. As an external api, it's clear that the model is not "thinking" in these logical terms, it just provides a translation step. I'd argue it would be better placed during inference test-time compute (as seen in these so-called reasoning models). Better yet, this formalizing step would happen at a lower level entirely, internal to the model, but that would probably require totally new architectures.
- Geee 2y agoYes, this is exactly what I've been dreaming about. It might finally be possible to beat the bullshit asymmetry law, i.e. Brandolini's law: "The amount of energy needed to refute bullshit is an order of magnitude bigger than to produce it." If LLMs can debunk bullshit as easily as it's generated, the world will instantly turn into a better place. Bad ideas which sound good are the root of all evil.
- RGamma 2y agoYou can just as easily imagine LLMs stoking the flames. Real world belief systems evolve along more complicated trajectories than addition of factual axioms and elimination of inconsistencies.
- tiberius_p 2y agoFirst order logic can only detect formal logic fallacies. Informal logic fallacies like ad hominem, strawman, red herring, etc. are cast in language. They can't me defined and resolved mathematically. The model should be fine tuned with examples of these informal fallacies and counter-arguments to them. Even so it won't be able to detect them in all cases, but it will at least have some knowledge about them and how to reply to them. This knowledge could be further be refined with in context learning and other prompt engineering strategies.
- jfengel 2y agoI would expect a true logical fallacy detector to take any natural text and spit out "unsupported assumption, unsupported assumption" over and over and over.
- grandempire 2y ago> ad hominem, strawman, red herring These aren’t logically incorrect, people who study rhetoric have just identified these as common patterns of poor persuasion.
- Quarondeau 2y agoCouldn't they be classified as non-sequiturs, given that the conclusion doesn't follow from the premises?
- grandempire 2y agoTake ad hominem. It’s true that there is no logical connection between who is saying something and whether it’s true. But in practice, that’s one of the most relevant factors of whether you should be listening to someone. Does this person have a solid track record? Do they have your interest in mind? So it is relevant information. It’s just that, “well once this guy kicked a dog” is usually done in bad faith. So I wouldn’t consider it a non-sequitor, except in its most crude forms.
- 2y ago
- hackandthink 2y agoFOL has serious limitations as natural language semantics (1). But with a good ontology you could certainly get relatively far, the authors have formulated it this way: "Correct identification of background knowledge is crucial for our method" Has there been progress in recent years? Or is Doug Lenat's CYC still state of the art? (1) https://people.engr.tamu.edu/ioerger/cs420-fall23/09_Uncertainty_Reasoning.pdf https://people.engr.tamu.edu/ioerger/cs420-fall23/09_Uncerta...
- sergix 2y agohttps://xkcd.com/2610/ https://xkcd.com/2610/
- booleandilemma 2y agoThis is a threat to my company's product managers.
- CJefferson 2y agoTurning English into logic basically requires understanding the language and context. I’d you are told “we will go to the zoo or swimming pool tomorrow, if it is windy or rainy”, most readers would know the first or is exclusive (we aren’t going to both), while the second is inclusive (we will go if it is windy, rainy, or both). This is annoying when teaching logic, from experience.
- someothherguyy 2y agoNo it doesn't. It just requires producing many possible interpretations and resolving more probable ones.
- procaryote 2y agoThe most probable logical interpretation of a phrase, not looking at context, might not be correct. Even something as simple as sarcasm breaks this idea, and you can have full books of metaphor that only make sense if you understand the cultural context in which they were written.
- talles 2y agoThe entire analytic philosophy movement is nowhere to be seen in the paper (?)
- grandempire 2y agoIt’s a nerd fantasy to imagine argumentation is a logical formula, and by memorizing all the bad forms you will win arguments and detect falsehood.
- ofrzeta 2y agoI thought we had already gone through this with Carnap and Logical Positivism.
- raffraffraff 2y agoI'm in the process of reading the PDF but if anyone has finished it, is there an implementation of this running somewhere? Is it testable now?
- igleria 2y agoI chuckled a little when I pictured 2 internat randos having the typical internet fight "enhanced" by AI
- gcanyon 2y agoFacebook needs to implement this as a flag, immediately. (kidding, of course -- it would nuke 98% of their content)
- anentropic 2y agoApart from the fact it's focused on logical fallacies, this is reminiscent of AWS Bedrock Automated Reasoning, which also appears to involve some kind of LLM-guided translation of natural language into logical rules ... which are then used to validate the output of the LLM application https://aws.amazon.com/blogs/aws/prevent-factual-errors-from-llm-hallucinations-with-mathematically-sound-automated-reasoning-checks-preview/ https://aws.amazon.com/blogs/aws/prevent-factual-errors-from...