<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ercan Canhasi</title>
    <description>The latest articles on DEV Community by Ercan Canhasi (@ercancanhasi).</description>
    <link>https://dev.to/ercancanhasi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250687%2F86869a35-1d06-4aa1-80d4-4e0df0db9c21.jpg</url>
      <title>DEV Community: Ercan Canhasi</title>
      <link>https://dev.to/ercancanhasi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ercancanhasi"/>
    <language>en</language>
    <item>
      <title>Giving an AI agent 30+ PDF tools with the Foxit MCP Server</title>
      <dc:creator>Ercan Canhasi</dc:creator>
      <pubDate>Tue, 24 Nov 2026 11:49:22 +0000</pubDate>
      <link>https://dev.to/ercancanhasi/giving-an-ai-agent-30-pdf-tools-with-the-foxit-mcp-server-nm0</link>
      <guid>https://dev.to/ercancanhasi/giving-an-ai-agent-30-pdf-tools-with-the-foxit-mcp-server-nm0</guid>
      <description>&lt;h4&gt;
  
  
  A short look at an open-source MCP server for PDF work
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnqsnd016zph37en5y5h.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnqsnd016zph37en5y5h.jpeg" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PDF files are still a big part of my work. Many Albanian texts I collect for research exist only as PDFs, and often as scans.&lt;/p&gt;

&lt;p&gt;This week I read a guide from Foxit about their MCP Server. It is open source, and it gives an AI agent more than 30 PDF tools. These include conversion, OCR, merge, split, compress and compare.&lt;/p&gt;

&lt;p&gt;The setup looks simple. You create a free developer account, clone the repo, and add a few lines to the config. It works with Claude Desktop, VS Code and Cursor. After that, you just write what you need, for example “convert this Word file to PDF and compress it”. The agent picks the right tools and asks for your approval before each call.&lt;/p&gt;

&lt;p&gt;One thing I liked is that the guide is honest about the limits. eSign and DocGen are separate APIs, not MCP tools, and the guide explains how to connect them.&lt;/p&gt;

&lt;p&gt;I plan to test the OCR on Albanian documents, and to show it to my students as an MCP example.&lt;/p&gt;

&lt;p&gt;You can read the full guide here: &lt;a href="https://developer-api.foxit.com/developer-blogs/use-cases-workflow-examples/automated-document-pipelines/foxit-mcp-server-ai-pdf-tools/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=influencer_distribution&amp;amp;utm_content=foxit_mcp_server" rel="noopener noreferrer"&gt;Foxit MCP Server: 30+ PDF Tools for AI Agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>pdf</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Fake News Writers Don’t Type “ë”</title>
      <dc:creator>Ercan Canhasi</dc:creator>
      <pubDate>Tue, 17 Nov 2026 23:40:22 +0000</pubDate>
      <link>https://dev.to/ercancanhasi/fake-news-writers-dont-type-e-384i</link>
      <guid>https://dev.to/ercancanhasi/fake-news-writers-dont-type-e-384i</guid>
      <description>&lt;h4&gt;
  
  
  What we learned when we built the first public fake news corpus for Albanian and trained machines to detect fake stories
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnd5u5vm1nxluxgdxgvi7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnd5u5vm1nxluxgdxgvi7.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use Facebook in Kosovo or Albania, you have seen these posts many times. A dramatic headline, a famous name, a promise: &lt;em&gt;“You will not believe what this Kosovar did in Switzerland.”&lt;/em&gt; You click and land on a page full of ads. The story is short, the promised answer never comes, and at the end there is a line like &lt;em&gt;“Sht1pe reklamen dhe sh1ko v1deon”&lt;/em&gt; (click the ad and watch the video), with the digit 1 in place of the letter i.&lt;/p&gt;

&lt;p&gt;Together with Rexhep Shijaku and Erblin Berisha, I studied whether such content can be detected automatically in Albanian. The work was published in ACM Transactions on Asian and Low-Resource Language Information Processing (TALLIP), together with a public dataset, the Alb-Fake-News-Corpus. In this post I summarize the methodology and the main results, with a bit more technical detail than a usual blog post.&lt;/p&gt;

&lt;h3&gt;
  
  
  Motivation and research questions
&lt;/h3&gt;

&lt;p&gt;Most fake news research is done for English. Well-known resources such as LIAR (Wang, 2017) and FakeNewsNet (Shu et al., 2020) are English only. For other languages, datasets are few and often small: a few hundred labeled items for Dutch, Chinese or Italian, and one larger aligned corpus for Brazilian Portuguese (Silva et al., 2020). For Albanian, a morphologically rich language with two main dialects and very few NLP resources, there was no dataset at all.&lt;/p&gt;

&lt;p&gt;We formulated five research questions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q1.&lt;/strong&gt; How can a fake news corpus be compiled efficiently for a low-resource language?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2.&lt;/strong&gt; What is the best, and smallest, set of features for Albanian fake news classification?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3.&lt;/strong&gt; Which classification methods work best?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q4.&lt;/strong&gt; Does text length bias the classification results?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q5.&lt;/strong&gt; How much do the news source and its writing style affect the results?&lt;/p&gt;

&lt;h3&gt;
  
  
  Building the corpus (Q1)
&lt;/h3&gt;

&lt;p&gt;Locating fake news is much harder than locating true news. Our starting hypothesis, based on experience with the Albanian web, was that most fake stories shared on Facebook originate from a small number of web portals. If these sources can be identified, collection can be largely automated.&lt;/p&gt;

&lt;p&gt;The pipeline had these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Seed.&lt;/strong&gt; About 100 articles already labeled as fake or true by a fact-checking site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source discovery.&lt;/strong&gt; Searching Facebook by article URL, title and domain. Reliable outlets typically had one verified page per website (a ratio of 1:1). Unreliable sources had no contact data, unverified pages, names unrelated to the domain, and spread content across multiple domains (a ratio of about 1:2). Several of these pages had earlier posted on unrelated topics, which suggests they changed owners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collection.&lt;/strong&gt; All posts from 25 selected pages over a six-month window in 2020, about 24,700 posts in total.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grouping and deduplication.&lt;/strong&gt; Posts were grouped by target article, and near-duplicates were removed using cosine similarity of titles. More than one third of the fake posts were removed in this step, so fake content is heavily re-posted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full-text retrieval.&lt;/strong&gt; A single scraper with domain-specific XPath rules. Many posts from unreliable pages pointed to pages that no longer existed. These were dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual verification.&lt;/strong&gt; True news from reliable portals was not checked manually. All 3,900 unique articles from unreliable sources were checked by the authors, and an article was kept as fake only when at least two of three annotators agreed. 2,000 articles remained.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alignment.&lt;/strong&gt; Each fake article was paired with a topically related true article using topic modeling. This is topical alignment, not a one-to-one rebuttal, which would be far more expensive to produce.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final corpus has &lt;strong&gt;4,000 articles, 2,000 fake and 2,000 true&lt;/strong&gt; , and is public on GitHub.&lt;/p&gt;

&lt;p&gt;Qualitatively, most Albanian fake news is clickbait. The headline opens a “curiosity gap” on a sensitive or popular topic, and the article under-delivers. The two classes also differ clearly in basic statistics (POS counts are normalized):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Statistic True Fake
Avg. tokens per article 275.6 114.6
Avg. unique words 146.5 74.1
Avg. word length (chars) 5.2 4.9
Avg. sentences per article 5.1 2.8
Avg. sentence length (words) 54.9 40.6
Verbs 58.2 65.3
Adverbs 7.2 7.8
Pronouns 7.1 9.5
Nouns 66.8 65.8
Adjectives 15.2 14.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fake articles are less than half as long as true ones, and they use relatively more verbs, adverbs and pronouns. The length difference is important, and we return to it under Q4.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experimental setup
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Engineered features.&lt;/strong&gt; We designed 267 features in seven groups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;character-level features, such as character unigrams and the most common bigrams and trigrams (120)&lt;/li&gt;
&lt;li&gt;digits, special characters and punctuation (40)&lt;/li&gt;
&lt;li&gt;word-level features, including out-of-vocabulary counts and frequent word n-grams (22)&lt;/li&gt;
&lt;li&gt;POS-based features (60)&lt;/li&gt;
&lt;li&gt;sentence and article features, such as title-body cosine similarity (4)&lt;/li&gt;
&lt;li&gt;a lying-detection set: vocabulary and grammatical complexity, Flesch-Kincaid grade, certainty and tentative words, affective terms, non-immediacy (15)&lt;/li&gt;
&lt;li&gt;psycholinguistic features based on lists of 200 positive and negative emotion words built for Albanian (6)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;POS tags came from Gjirafa’s internal neural tagger (58 tags, F1 of 0.97). Features were z-score normalized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Text representations.&lt;/strong&gt; TF-IDF bag-of-words (BoW), Word2Vec, FastText and BERT. When no pre-trained Albanian model was available, we trained one on two years of crawled Albanian news.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Classifiers.&lt;/strong&gt; Logistic regression, Naive Bayes, SVM, decision trees, random forests, KNN and XGBoost, all with default hyperparameters. The aim was to evaluate the corpus, not to tune models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Metrics.&lt;/strong&gt; We used the measures common in spam filtering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FCR&lt;/strong&gt; (fake news caught rate, which is recall on the fake class)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FPR&lt;/strong&gt; (fake news precision)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LBR&lt;/strong&gt; (legitimate news blocked rate, which is the false positive rate)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fm&lt;/strong&gt; (the harmonic mean of FCR and FPR)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Which features and which methods (Q2, Q3)
&lt;/h3&gt;

&lt;p&gt;With all 267 engineered features, XGBoost was best on all four metrics. It caught more than 90% of the fake news at an LBR of only 1.44%. Multinomial Naive Bayes was the weakest.&lt;/p&gt;

&lt;p&gt;Feature importance from tree ensembles gave a minimal set of 13 features with similar performance, in decreasing order of importance:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;number of nouns&lt;/li&gt;
&lt;li&gt;number of syllables&lt;/li&gt;
&lt;li&gt;number of punctuation marks&lt;/li&gt;
&lt;li&gt;frequency of the letter “ë”&lt;/li&gt;
&lt;li&gt;frequency of “.”&lt;/li&gt;
&lt;li&gt;frequency of the word “ua”&lt;/li&gt;
&lt;li&gt;frequency of the suffix “uar”&lt;/li&gt;
&lt;li&gt;number of uppercase characters&lt;/li&gt;
&lt;li&gt;number of complex words&lt;/li&gt;
&lt;li&gt;number of digits&lt;/li&gt;
&lt;li&gt;frequency of the suffix “ës”&lt;/li&gt;
&lt;li&gt;average sentence length&lt;/li&gt;
&lt;li&gt;number of out-of-vocabulary words&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The letter ë
&lt;/h3&gt;

&lt;p&gt;Feature 4 is the one that gives this post its title. Standard keyboards have no key for “ë”, although it is one of the most frequent letters in Albanian. Writing it correctly costs extra effort. Professional journalists usually make that effort. Fake news producers, who publish in large volume, usually type “e” instead. A purely orthographic signal therefore carries real information about reliability, because careless writing and deceptive writing tend to come from the same sources.&lt;/p&gt;

&lt;p&gt;Features 6, 7 and 11 (“ua”, “uar”, “ës”) are linked to the Tosk and Gheg dialects. For example, the standard (Tosk-based) participle “vonuar” (late) often appears as “vonum” in informal Gheg. Fake articles contained these standard forms less often.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is it a fake news detector or a dialect detector?
&lt;/h3&gt;

&lt;p&gt;This finding needs a control experiment. If dialect markers rank so high, the model might simply be detecting Gheg. We tested this in two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A classifier trained only on the dialect-related features was clearly less accurate than the full model.&lt;/li&gt;
&lt;li&gt;We evaluated the XGBoost model on 80 manually labeled articles in four groups of 20: Tosk true, Tosk fake, Gheg true and Gheg fake. The model recognized fake news in both dialects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dialect is therefore one signal among several, not a confounder that explains the results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Content-based representations
&lt;/h3&gt;

&lt;p&gt;For BoW, neither stop-word removal with stemming nor feature selection (the top 2,000 features) improved the results. This is unusual for text classification. It suggests that function words and inflected forms carry stylistic information that matters for this task.&lt;/p&gt;

&lt;p&gt;The best Fm values on full texts were:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BoW (TF-IDF) 0.909
Word2Vec 0.912
FastText 0.904
BERT 0.924
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The differences are small. With BoW, XGBoost caught on average 97% of the fake news, at an average LBR of 6%. In comparison, the 13-feature engineered model has a far lower dimensionality, so it is a cheap and fast option for production.&lt;/p&gt;

&lt;p&gt;Why did pre-trained models not win clearly? These models were trained on clean, standard Albanian. Fake news is full of slang, typos, abbreviations, obfuscations like “v1deon”, and non-standard Gheg. Embeddings trained on standard text represent this register poorly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Length bias (Q4)
&lt;/h3&gt;

&lt;p&gt;Since fake articles are much shorter, a model could learn “short means fake”. We checked this in three ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Length only.&lt;/strong&gt; A classifier that used only article length performed clearly worse. When all articles were truncated to 100 and then 50 words, it fell to nearly random performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truncated texts.&lt;/strong&gt; We truncated true articles to 50 words, which is close to the average length of the fake articles, and repeated the experiments. With BoW, the best Fm was 0.858 (0.863 with stop-word removal and stemming, 0.854 with feature selection). The drop from full texts was at most 5% Fm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineered vs. content features.&lt;/strong&gt; On truncated texts, the engineered features outperformed the content-based representations. On full texts, it was the other way round.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our reading is that there is a weak but real length bias, mostly for content-based models. We recommend training on length-truncated true news, because this setting is closer to real use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Source and style (Q5)
&lt;/h3&gt;

&lt;p&gt;During verification we found articles from unreliable sources whose content was not fake. We used them to build a harder task: fake versus non-fake articles, both from unreliable publishers. Performance dropped strongly, and more for engineered features than for content-based ones.&lt;/p&gt;

&lt;p&gt;This is perhaps the most important result. A large part of what the classifiers learn is the &lt;em&gt;writing style of unreliable publishers&lt;/em&gt;, not the truth value of the claims. Source and style are the strongest signals in this data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;p&gt;This study has clear limitations, and readers should keep them in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alignment.&lt;/strong&gt; Fake and true articles are matched by topic, not as claim and rebuttal pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification.&lt;/strong&gt; True news was assumed correct based on the reliability of its source and was not checked manually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Annotation.&lt;/strong&gt; The authors annotated the fake class themselves (majority of three). We did not report an inter-annotator agreement coefficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sampling.&lt;/strong&gt; The data covers 25 Facebook pages over six months in 2020, so topics and style reflect that period.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuning.&lt;/strong&gt; All classifiers used default hyperparameters, so the absolute scores are probably not the best possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why this matters now
&lt;/h3&gt;

&lt;p&gt;This paper was published in 2022, shortly before large language models became widely used. That changes the picture in two ways. Several cheap signals we found, such as a missing “ë”, broken words and very short texts, are easy for a language model to avoid. Machine-generated fake news will be fluent and orthographically correct. On the other hand, Q5 suggests that source- and style-level signals may be more robust than surface errors. Future work should also train Albanian language models on noisy, dialectal text, add social context such as comments, and test ensembles and stacking of models trained on different feature sets.&lt;/p&gt;

&lt;p&gt;The broader point is not specific to Albanian. Low-resource languages need their own carefully built, openly published benchmarks. Methods developed for English do not transfer automatically, and the errors are often hidden in places like a single letter on the keyboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;Canhasi, E., Shijaku, R., Berisha, E. (2022). Albanian Fake News Detection. &lt;em&gt;ACM TALLIP&lt;/em&gt; 21(5), Article 86. &lt;a href="https://doi.org/10.1145/3487288" rel="noopener noreferrer"&gt;https://doi.org/10.1145/3487288&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pérez-Rosas, V., Kleinberg, B., Lefevre, A., Mihalcea, R. (2018). Automatic Detection of Fake News. &lt;em&gt;COLING 2018&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Shu, K., Mahudeswaran, D., Wang, S., Lee, D., Liu, H. (2020). FakeNewsNet: A Data Repository with News Content, Social Context, and Spatiotemporal Information. &lt;em&gt;Big Data&lt;/em&gt; 8(3).&lt;/p&gt;

&lt;p&gt;Silva, R. M., Santos, R. L. S., Almeida, T. A., Pardo, T. A. S. (2020). Towards automatically filtering fake news in Portuguese. &lt;em&gt;Expert Systems with Applications&lt;/em&gt; 146.&lt;/p&gt;

&lt;p&gt;Wang, W. Y. (2017). “Liar, Liar Pants on Fire”: A New Benchmark Dataset for Fake News Detection. &lt;em&gt;ACL 2017&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Dataset:&lt;/em&gt; &lt;a href="https://github.com/rexshijaku/Alb-Fake-News-Corpus" rel="noopener noreferrer"&gt;&lt;em&gt;https://github.com/rexshijaku/Alb-Fake-News-Corpus&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>misinformation</category>
      <category>nlp</category>
      <category>fakenews</category>
      <category>ai</category>
    </item>
    <item>
      <title>Can a Machine Tell Where an Albanian Is From, Just by Reading One Tweet?</title>
      <dc:creator>Ercan Canhasi</dc:creator>
      <pubDate>Tue, 17 Nov 2026 22:42:41 +0000</pubDate>
      <link>https://dev.to/ercancanhasi/can-a-machine-tell-where-an-albanian-is-from-just-by-reading-one-tweet-37bm</link>
      <guid>https://dev.to/ercancanhasi/can-a-machine-tell-where-an-albanian-is-from-just-by-reading-one-tweet-37bm</guid>
      <description>&lt;h4&gt;
  
  
  How we built a geotagged multi-dialect corpus of Albanian from Twitter, and why the machine beat native speakers
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ASOPaYL7ewmJO62Vb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ASOPaYL7ewmJO62Vb" width="1024" height="1385"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Albanian dialects in the western Balkans. Figure 1 from Canhasi and Shijaku (2023), PLOS ONE, CC BY 4.0.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every Albanian knows the feeling. You read a few lines from someone online and after a moment you think: this person is from Kosovo. Or from Tirana. Or maybe from Tetovo. We are quite sure about it, but if somebody asks us &lt;em&gt;why&lt;/em&gt;, it is hard to explain.&lt;/p&gt;

&lt;p&gt;My colleague Rexhep Shijaku and I wanted to check if a machine can do the same thing, and if it can, what exactly it is looking at. The result was a paper in PLOS ONE and a public dataset, the AlbDialectCorpus. In this story I want to explain the work in simple words, without the formulas.&lt;/p&gt;

&lt;h3&gt;
  
  
  A small language with big differences
&lt;/h3&gt;

&lt;p&gt;Albanian is spoken by a few million people, but it is spread over several countries: Albania, Kosovo, North Macedonia, and a large diaspora in Europe and America. Traditionally the language is divided into two big dialect groups. Gheg is spoken in the north, and Tosk in the south, with the Shkumbin river in central Albania as the usual border line. Standard Albanian, the language of schools, newspapers and official documents, is based mostly on Tosk.&lt;/p&gt;

&lt;p&gt;In Kosovo and North Macedonia people speak Gheg varieties. In daily life, and especially on social media, people mix standard language and their local dialect all the time. Since Albanian is written “as it is spoken”, these differences are visible in text. Sometimes two words differ by only one letter.&lt;/p&gt;

&lt;p&gt;For NLP this is a real problem. Most tools treat Albanian as one thing. A spell checker, a translation system or a chatbot trained on standard Albanian will often fail on text from Prizren or Gostivar. To build better tools, first we need data that shows how people really write in each region. Such data did not exist, so we decided to build it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Twitter
&lt;/h3&gt;

&lt;p&gt;We chose Twitter (today X) for practical reasons. People write there in a natural and informal way, and at that time the API was open, so we could collect data at scale. Our main assumption was simple: where a user lives is a strong signal of which dialect they write in. Linguists have known this connection between language and geography since the nineteenth century.&lt;/p&gt;

&lt;p&gt;The problem is that almost nobody tells Twitter where they live. Only 1 to 2 percent of tweets carry a location, and the “location” field in a profile is free text. People write whatever they want there.&lt;/p&gt;

&lt;h3&gt;
  
  
  You are where your friends are
&lt;/h3&gt;

&lt;p&gt;So we used a different idea. A local politician, journalist or influencer is mostly followed by people from the same place. If you follow many Kosovar journalists, there is a good chance you are in Kosovo.&lt;/p&gt;

&lt;p&gt;We started with 60 hand-picked “hub” accounts, 20 from each region: politicians from different parties, journalists, entrepreneurs, influencers and also ordinary users. From their followers we got 25,939 accounts, which became 18,619 after removing duplicates. Then we removed spam accounts (accounts that follow more than two thousand others) and were left with 13,812 valid users.&lt;/p&gt;

&lt;p&gt;Next we had to read the location fields. Here we saw how creative people are. The city of Prizren, for example, appeared as “Prizren”, as “Pz”, and even as “04”, which is its car plate code. We wrote a small geoparsing algorithm to handle such cases, and it doubled the number of located users in Kosovo and Albania, and increased it about seven times for North Macedonia.&lt;/p&gt;

&lt;p&gt;For the users who still had no location, we trained a classifier. It looks only at the social network: which of the 60 hubs a user follows, how important each hub is, plus some profile information like account age. With XGBoost this model guessed the country correctly 87.4% of the time, without reading a single tweet. “You are where your friends are” really works.&lt;/p&gt;

&lt;h3&gt;
  
  
  When language detectors do not recognize your language
&lt;/h3&gt;

&lt;p&gt;The next surprise came during cleaning. Users in these regions do not tweet only in Albanian. In Kosovo you find English, Turkish, Serbian, Bosnian and German. In North Macedonia, Macedonian and Bulgarian. In Albania, a lot of Italian. We wanted to remove all non-Albanian tweets.&lt;/p&gt;

&lt;p&gt;The obvious solution was to use a standard language identification tool like fastText. But it had one big flaw: it often did not recognize Gheg tweets as Albanian at all. A tweet in pure Kosovo dialect looked to the tool like some unknown language. If we had trusted the tool, we would have thrown away exactly the tweets that were most valuable for us.&lt;/p&gt;

&lt;p&gt;We solved this with a combination. When fastText was very confident that a tweet is Albanian, we took it as standard Albanian. When fastText was confused, we passed the tweet to a small dialect model we trained ourselves, based on word n-grams. For me this is an important lesson for every low-resource language: the tools that work fine for the standard language can quietly erase the dialects.&lt;/p&gt;

&lt;p&gt;We also replaced names of people, cities and countries with a generic token. Otherwise the model would learn that “Prishtina” means Kosovo and “Tirana” means Albania, which is true but not very interesting for dialect research.&lt;/p&gt;

&lt;h3&gt;
  
  
  The final corpus
&lt;/h3&gt;

&lt;p&gt;In the end the AlbDialectCorpus has 2,503 users (835 from North Macedonia, 867 from Kosovo and 801 from Albania), almost 169,000 tweets, and about 2.25 million tokens. It is publicly available on GitHub and Zenodo, so anyone can use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The machine against native speakers
&lt;/h3&gt;

&lt;p&gt;Then we trained many classifiers to predict the dialect: logistic regression, Naive Bayes, decision trees, random forests, KNN, XGBoost, support vector machines and fastText. The best one was a simple linear SVM. When it could see all tweets of a user, it reached an F1 score of 0.941. When it had to decide from a &lt;strong&gt;single tweet&lt;/strong&gt; , often only ten or twelve words long, it still reached about 0.82.&lt;/p&gt;

&lt;p&gt;To compare, we gave samples to four native-speaker annotators. Their average accuracy was 0.73 at the user level and 0.69 at the tweet level. The machine was clearly better.&lt;/p&gt;

&lt;p&gt;The interesting part is &lt;em&gt;where&lt;/em&gt; humans failed. They recognized standard Albanian and Tosk almost perfectly. Kosovo Gheg was also mostly fine. But the Gheg of North Macedonia was a real problem: annotators recognized it correctly in less than one third of cases, and most of the time they took it for Kosovo. For the classifier too, Kosovo and North Macedonia were the two classes it confused most. This makes sense, as both are Gheg and the regions are close to each other, but the machine still separated them much better than we did.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the model is looking at
&lt;/h3&gt;

&lt;p&gt;A good accuracy number is nice, but I wanted to know &lt;em&gt;why&lt;/em&gt; the model decides as it does. We used two tools to open the black box: SHAP values, and archetypal analysis, a method I have worked with for many years.&lt;/p&gt;

&lt;p&gt;The model found small words that people use without thinking. For North Macedonian Gheg, words like “xhi”, “majr”, “ama” and “ene” were among the strongest signals. For the southern, standard side, words like “qenë” and “pranë” stood out. Most native speakers will recognize these patterns when they see them. But many of them are not well described in the scientific literature. In a way, the model found knowledge that people carry in their heads but never wrote down.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations, honestly
&lt;/h3&gt;

&lt;p&gt;This work has limits. Geotagging through friends makes mistakes, especially for users whose network crosses borders. Tweets are short, and Twitter users are not a perfect sample of the population. Dialects also change over time, so a dataset from social media will slowly get old. And since Twitter closed its free API, building such a corpus today would be much harder and more expensive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why this matters now
&lt;/h3&gt;

&lt;p&gt;When we wrote this paper, large language models were just becoming popular. Today everybody uses them, and the question of dialects is even more important. If AI systems learn Albanian only from standard, formal text, they will serve people from Tirana better than people from Prizren or Tetovo. They will also be worse at understanding the way most of us really write online.&lt;/p&gt;

&lt;p&gt;Small languages need their own data, and dialects inside small languages need it even more. This corpus is one small step in that direction, and I hope other researchers will use it, improve it, and build on it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The paper: Canhasi E., Shijaku R. (2023). Using Twitter to collect a multi-dialectal corpus of Albanian using advanced geotagging and dialect modeling. PLOS ONE 18(11): e0294284.&lt;/em&gt; &lt;a href="https://doi.org/10.1371/journal.pone.0294284" rel="noopener noreferrer"&gt;&lt;em&gt;https://doi.org/10.1371/journal.pone.0294284&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The dataset:&lt;/em&gt; &lt;a href="https://github.com/rexshijaku/albanian-dialect-corpus" rel="noopener noreferrer"&gt;&lt;em&gt;https://github.com/rexshijaku/albanian-dialect-corpus&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(DOI 10.5281/zenodo.8349099)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>linguistics</category>
    </item>
    <item>
      <title>The Mirror Test: LLM Self-Awareness and the Claude Code Leak</title>
      <dc:creator>Ercan Canhasi</dc:creator>
      <pubDate>Tue, 17 Nov 2026 22:33:11 +0000</pubDate>
      <link>https://dev.to/ercancanhasi/the-mirror-test-llm-self-awareness-and-the-claude-code-leak-518i</link>
      <guid>https://dev.to/ercancanhasi/the-mirror-test-llm-self-awareness-and-the-claude-code-leak-518i</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AeeubwdeZtGaRIpxK" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AeeubwdeZtGaRIpxK" width="1024" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For quite some time I have been noticing a pattern that initially seemed like a minor inconvenience. After discussing it privately with colleagues, including Hakan Shehu , I began to recognize that the issue runs far deeper than surface-level tooling complaints. It is fundamental, structural, and in my view, deeply revealing. That realization pushed me to think more carefully, analyze the evidence, and research the broader implications.&lt;/p&gt;

&lt;p&gt;The problem does not belong to any particular agent or product. It belongs to LLMs as a category. The inability to spontaneously apply self-knowledge is baked into how these models are built and trained, and no amount of prompt engineering or smarter wrappers will address it at the root.&lt;/p&gt;

&lt;p&gt;In my view, this gap also points to what may be the most straightforward way of testing AI self-awareness, starting with coding agents and extending all the way up to frontier models. When a model cannot implicitly draw on its own nature to solve a problem, that is a meaningful signal worth paying attention to. The recent leak of the Claude Code source makes the point more concretely than any theoretical argument could.&lt;/p&gt;

&lt;p&gt;The article proceeds as follows: first, the background and structure of the problem; then, real-world examples drawn from billion-dollar companies’ codebases; and finally, some conclusions about what all of this tells us about where we actually stand.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;When Claude, or any of the leading coding agents, is asked to handle a task that involves understanding human language, such as detecting frustration, interpreting intent, or classifying tone, it will almost instinctively reach for the same tools programmers have used for decades: lists of keywords, pattern matching, and regular expressions.&lt;/p&gt;

&lt;p&gt;To be fair, there is nothing inherently wrong with that approach. It served the software industry well for many years, and in simple cases it still does.&lt;/p&gt;

&lt;p&gt;But here is where it gets interesting. These coding agents are not just programs that happen to know about AI. They are themselves built on top of large language models. They understand nuance, context, sarcasm, and ambiguity in ways that no keyword list ever could. In other words, they already possess the perfect tool for the job. They simply never think to use it on themselves.&lt;/p&gt;

&lt;p&gt;It would be like asking a master chef to taste a dish and having them reach for a printed flavor chart instead of just using their own palate. The better instrument is not somewhere else. It is the chef themselves.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Best Solution
&lt;/h3&gt;

&lt;p&gt;Interestingly, when explicitly told to use an LLM for the task, coding agents will comply, and they will do it well. The capability is clearly there. The knowledge is there. What is missing is the unprompted recognition that this is the right approach in the first place. They need to be told what they should, in theory, already know about themselves.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Deeper Problem
&lt;/h3&gt;

&lt;p&gt;Put simply, these models do not spontaneously reflect on what they are capable of when deciding how to solve a problem. They do not ask themselves: “What is the best tool available to me, given my own nature?” They just pattern-match to the most familiar solution and proceed.&lt;/p&gt;

&lt;p&gt;*A note for the reader: this observation should not be confused with a critique of tool selection or tool usage. That is an entirely separate dimension. The argument here operates on a more fundamental level, one of identity and self-knowledge, not capability or workflow.&lt;/p&gt;

&lt;p&gt;Insight: Modern coding agents have no internal model of what they fundamentally are. They do not know their own nature. And because they do not know their own nature, they cannot reason from it. In that specific and narrow sense, they fall below the self-awareness threshold of even the most primitive animals, not in intelligence, not in capability, but in the one thing that matters here: knowing what you are.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Possible objection: “So what? We as vibe coders can simply step in and guide them.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer is more uncomfortable than it appears: a vibe coder who is not aware of their own blind spots cannot compensate for blind spots they have never recognized. You cannot patch a gap you cannot see.&lt;/p&gt;

&lt;h3&gt;
  
  
  An Even Deeper Insight
&lt;/h3&gt;

&lt;p&gt;In my humble opinion, without this level of self-awareness, coding models will not be able to write better versions of themselves in the near future. Hence, no generally intelligent coder is possible, for now? For more on this, the next article will go deeper into this topic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;With the theoretical background in place, it is time to look at concrete evidence. Personal experience has its value, but let us start with something more verifiable: a real function pulled from the leaked Claude Code internal source, one that illustrates the problem more plainly than any argument could.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem in Code: Regex-Driven Sentiment Detection
&lt;/h3&gt;

&lt;p&gt;Here is the actual function from the leaked Claude Code internal source. It checks whether a given input string contains negative or frustrated language by matching it against a predefined regular expression of keywords and phrases:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;matchesNegativeKeyword&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;lowerInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;negativePattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="nf"&gt;b&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wtf&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;wth&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;ffs&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;omfg&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nf"&gt;shit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ty&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;tiest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?|&lt;/span&gt;&lt;span class="n"&gt;dumbass&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;horrible&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;awful&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nf"&gt;piss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ed&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;ing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;piece&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;shit&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;crap&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;junk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;what&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fuck&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;hell&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;fucking&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;broken&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;useless&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;terrible&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;awful&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;horrible&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;fuck&lt;/span&gt; &lt;span class="n"&gt;you&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;screw&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;you&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;so&lt;/span&gt; &lt;span class="n"&gt;frustrating&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="kc"&gt;this&lt;/span&gt; &lt;span class="n"&gt;sucks&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;damn&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;negativePattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lowerInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The code above is reportedly sourced from the leaked internal source code of Claude Code, revealing how such systems may detect negative user intent.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a brittle, static list. It will miss novel expressions of frustration, misfire on quoted or ironic usage, and requires manual maintenance every time language evolves.&lt;/p&gt;

&lt;p&gt;For my non-coder or vibe-coder friends, a simple analogy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;It’s like a mechanic using only a hammer in a workshop full of precision tools.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;These agents are like experts at tracing shadows on the wall, unaware they could simply turn around and look at the object itself.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And if the reader will excuse the indulgence, that last one is the more Platonic of the two analogies.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Better Solution: LLM-Based Tone Classification
&lt;/h3&gt;

&lt;p&gt;Instead of relying on a brittle regex list, a self-aware coding agent would delegate this judgment to an LLM, the very technology it is an instance of. Here is a pseudocode blueprint for what that looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FUNCTION detect_negative_or_frustrated_intent(user_text, conversation_context):

    INPUT:
        user_text
        conversation_context // optional recent messages, task state, prior errors

    PREPROCESS:
        normalized_text = trim(user_text)
        IF normalized_text is empty:
            RETURN {
                label: "neutral",
                confidence: 0.0,
                reason: "empty input"
            }

    BUILD_PROMPT:
        system_instruction = """
        You are a tone classifier for a coding assistant.
        Decide whether the user's message expresses:
        1. neutral
        2. mildly negative
        3. frustrated
        4. abusive

        Use meaning and context, not only keywords.
        Distinguish between:
        - harmless quoting or discussion of bad words
        - actual frustration directed at the tool or task
        - direct abuse toward the assistant or a person

        Return strict JSON only.
        """

        user_payload = {
            "message": normalized_text,
            "context": conversation_context,
            "task": "Classify negativity/frustration in the message",
            "output_schema": {
                "label": "neutral | mildly_negative | frustrated | abusive",
                "confidence": "0.0 to 1.0",
                "contains_negative_sentiment": "true | false",
                "should_trigger_recovery_behavior": "true | false",
                "reason": "short explanation"
            }
        }

    CALL_LLM:
        llm_result = LLM(system_instruction, user_payload)

    VALIDATE_OUTPUT:
        parsed = parse_json(llm_result)
        IF parsed is invalid:
            RETURN fallback_rule_based_classifier(normalized_text)

    APPLY_BUSINESS_RULES:
        IF parsed.label == "abusive":
            action = "apply_safety_or_boundary_response"
        ELSE IF parsed.label == "frustrated":
            action = "acknowledge_problem_and_offer_fix"
        ELSE IF parsed.label == "mildly_negative":
            action = "respond_supportively_and_continue"
        ELSE:
            action = "continue_normally"

    RETURN {
        label: parsed.label,
        confidence: parsed.confidence,
        contains_negative_sentiment: parsed.contains_negative_sentiment,
        should_trigger_recovery_behavior: parsed.should_trigger_recovery_behavior,
        action: action,
        reason: parsed.reason
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach understands meaning, not just surface patterns. It can distinguish a frustrated user from someone quoting an error message. It handles sarcasm, context, and novel phrasing. And critically, it does so by using the same capability the agent already has access to, but never thought to reach for.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusions
&lt;/h3&gt;

&lt;p&gt;This is only one example of many I have experienced while using coding agents. The regex-driven, keyword-based fallback is not an isolated quirk. It is a pattern, and a revealing one. It suggests that the gap between what these models know and what they apply to themselves is not a minor technical limitation, but a structural blind spot baked into the LLMs themselves.&lt;/p&gt;

&lt;p&gt;Self-awareness, even in its most primitive biological form, is what allows an agent to match the right tool to the right problem. Without it, even the most capable coding agent remains a sophisticated pattern-matcher, powerful within the boundaries it was shown, but unable to reason about its own nature or leverage its own deepest capabilities.&lt;/p&gt;

&lt;p&gt;The irony is sharp: the very technology that could solve these interpretation problems more elegantly than any regex ever could sits unused, not because it is unavailable, but because it was never considered.&lt;/p&gt;

&lt;p&gt;This might also be one of the simplest and most honest tests we have for measuring how far we are from AGI. Not benchmarks, not reasoning scores, not coding competitions. Just one question: can the model, unprompted, recognize that its own nature is the best tool for the task in front of it? The day a coding agent reaches for an LLM to solve a language problem without being told to, not because it was fine-tuned to do so but because it reasoned its way there, that day will tell us something benchmarks never could. We are not there yet.&lt;/p&gt;

&lt;p&gt;I am sure others have encountered various experiences in this same category, and I would very much like to hear from you. The more we map these blind spots collectively, the better we understand what truly remains between today’s coding agents and anything deserving the label of general intelligence.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://www.linkedin.com/pulse/mirror-test-llm-self-awareness-claude-code-leak-ercan-canhasi-vn6lf/" rel="noopener noreferrer"&gt;&lt;em&gt;https://www.linkedin.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>claudecode</category>
      <category>programming</category>
      <category>llm</category>
    </item>
    <item>
      <title>Why AI Hallucinations Are Worse Than Lies: Frankfurt’s Theory of Bullshit and the LLM</title>
      <dc:creator>Ercan Canhasi</dc:creator>
      <pubDate>Tue, 17 Nov 2026 17:39:23 +0000</pubDate>
      <link>https://dev.to/ercancanhasi/why-ai-hallucinations-are-worse-than-lies-frankfurts-theory-of-bullshit-and-the-llm-539p</link>
      <guid>https://dev.to/ercancanhasi/why-ai-hallucinations-are-worse-than-lies-frankfurts-theory-of-bullshit-and-the-llm-539p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AOI8UXSsfaoi0cZ2r" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AOI8UXSsfaoi0cZ2r" width="760" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While browsing through some of my older books recently, I came across the slim, provocative volume of On Bullshit by Harry Frankfurt. Frankly, in some mysterious way, this slim book attracted me to itself. I decided to review the marginalia and notes I took many years ago on the margins of the book. What hugely surprised me was the great similarity between Frankfurt’s central thesis and the very modern problem of LLM hallucinations. The intersection of this classical philosophical analysis with the technical failures of contemporary AI was too interesting to ignore. So I decided to write this article connecting the two fields.&lt;/p&gt;

&lt;p&gt;Frankfurt’s essay, first published in 1986 and later released as the globally recognized short book On Bullshit, became a cultural phenomenon precisely because it identified a ubiquitous but unexamined problem in modern discourse. The essay is a rigorous attempt at analytical definition. Frankfurt’s core task was to establish the precise meaning of bullshit to differentiate it from lying (Frankfurt, 2005). He argues that the true menace of bullshit stems from the speaker’s profound lack of concern for the truth, distinguishing it sharply from the liar who, by necessity, respects the truth enough to try and hide it. This subtle but devastating distinction provides the exact philosophical framework required to assess the output of modern AI.&lt;/p&gt;

&lt;p&gt;In our modern digital world, we are forced to confront an existential question regarding knowledge itself. The Large Language Models (LLMs), the sophisticated engines behind tools like GPT and Gemini, process petabytes of text and yet routinely present confidently stated, but entirely fabricated information. This phenomenon, often defensively categorized as “hallucination,” is far more than a simple technical glitch or a retrieval error.&lt;/p&gt;

&lt;p&gt;When these artificial intelligences generate a meticulously detailed but specious legal precedent or an utterly wrong historical attribution, we are witnessing the natural product of a machine built for persuasive coherence, not factual constraint. To grasp the gravity of this digital indifference, we must turn our gaze back to the philosophical groundwork laid by Harry G. Frankfurt in his essential work, On Bullshit.&lt;/p&gt;

&lt;p&gt;Frankfurt provides a profound tool for dismantling this problem through his analytical distinction between the liar and the bullshitter. This differentiation is rooted in the speaker’s epistemic commitment, or lack thereof, to the facts of the matter.&lt;/p&gt;

&lt;p&gt;The liar is intrinsically bound to the truth. They must know what the truth is to effectively conceal it, misrepresent it, or guide their audience away from it. The lie is thus fundamentally anchored in reality; its power is dependent upon its opposition to a known fact.&lt;/p&gt;

&lt;p&gt;The bullshitter, conversely, is characterized by a radical indifference to the truth. They are not concerned with whether their statements are true or false, but solely with how their discourse serves a specific, non-truth-related purpose. By doing this, they try to impress, to signal allegiance, or simply to satisfy the demand to speak. While the technical focus of this article is more on AI, it is impossible to discuss the bullshitter’s “lack of concern for the truth” without briefly acknowledging its modern sociopolitical application (Frankfurt, 2005).&lt;/p&gt;

&lt;p&gt;An Unavoidable Parallel: Bullshit and Populism&lt;/p&gt;

&lt;p&gt;Populist political rhetoric, across the ideological spectrum, often exemplifies this indifference. When a leader consistently prioritizes emotional situation and audience satisfaction over factual fidelity, they are engaging in rhetoric that is fundamentally unconcerned with “how things really are.” The content is not necessarily a calculated lie but rather a performance crafted for maximum plausibility and effect, echoing the LLM’s goal of generating linguistically fluent output.&lt;/p&gt;

&lt;p&gt;Side note: My next article could be about extensive usage of LLMs for political bullshitting: case study of R. Kosov*(a/o)!!!&lt;/p&gt;

&lt;p&gt;This parallel is crucial because the danger is the same: the constant production of high-volume, emotionally resonant, yet factually empty claims saturates the discourse. This systemic degradation of truth as a standard is what connects the philosophical issue of political rhetoric directly to the automated indifference of the LLM, making the core Frankfurtian critique universally relevant to our information ecosystem.&lt;/p&gt;

&lt;p&gt;This philosophical indifference finds its perfect operational mirror in the contemporary transformer architecture of Large Language Models.&lt;/p&gt;

&lt;p&gt;There is an ongoing and rigorous debate in the AI community regarding emergent abilities and the extent to which LLMs form internal “world models” through training. Nevertheless, it is crucial to analyze the technology through the lens of its objective function. The LLM is, at its foundation, an immensely scaled, high-dimensional system optimized for language generation. Modern production models undergo rigorous fine-tuning through methods like Reinforcement Learning from Human Feedback (RLHF). These methods successfully align the model to complex human preferences for safety, helpfulness, and style, and this alignment addresses how the model behaves, not its epistemic commitment to reality. Its underlying computational directive remains one of maximizing a reward signal, whether that is predicting the next token in pre-training, or maximizing the human preference score in fine-tuning. Its primary goal is still to generate the most statistically coherent and plausible sequence of words. This process is driven by optimization for stylistic fluency and coherence, not factual constraint. Factual verification is not an intrinsic part of its generative loop, regardless of any latent structural knowledge it may acquire.&lt;/p&gt;

&lt;p&gt;Consequently, when an LLM hallucinates, it is not an act of deception, nor is it necessarily a failure to “understand” in a human sense. It is more of an act of flawless technical execution of its programming. The model, lacking any internal epistemic module or explicit mechanism for real-world factual grounding, is simply succeeding at its primary function: outputting highly plausible text, even when that text utterly lacks an anchor in verifiable reality. The entire machine architecture is built around the ideal of seamless, persuasive language, operating with absolute unconcern for factual constraints. The LLM is, therefore, the ultimate, most sophisticated artificial bullshitter.&lt;/p&gt;

&lt;p&gt;Within the technical community, the term “hallucination” is itself a generalization for several distinct failure modes, each stemming from the probabilistic nature of the LLM. We can categorize these failures broadly as Intrinsic and Extrinsic hallucinations.&lt;/p&gt;

&lt;p&gt;Intrinsic Hallucinations occur when the generated output directly contradicts the information present in the source documents or the training corpus. These are deep, internal conflicts arising from the model’s compromised “memory” during the token sampling process. They reflect an instability in the attentional mechanism or a localized “memory corruption” within the high dimensional latent space (Ho et al., 2024).&lt;/p&gt;

&lt;p&gt;Extrinsic Hallucinations, conversely, generate facts that are simply unverifiable or inconsistent with reality, specifically due to the model’s knowledge cutoff. The model, when asked about a recent event, defaults to confabulation based on its pre-trained statistical weightings, as its fundamental inability to state “I don’t know” overrides its lack of up-to-date factual grounding.&lt;/p&gt;

&lt;p&gt;Current industry attempts to mitigate this, such as Retriever Augmented Generation (RAG), are effectively external human interventions designed to impose a form of truth-telling discipline. RAG forces the model to condition its output on a set of verified, retrieved documents, transforming the task from pure generation to contextual summarization. When RAG fails, the model exhibits context window saturation or simply disregards the retrieved truth to revert to its intrinsic, ungrounded probabilistic style-it chooses its own fluent bullshit over the restrictive constraint of fact.&lt;/p&gt;

&lt;p&gt;Frankfurt makes the compelling argument that bullshit is a greater enemy of the truth than lies are. While the liar implicitly respects the value of truth by acknowledging its existence, the bullshitter disregards it completely, thereby degrading the cultural practice of attending to the facts.&lt;/p&gt;

&lt;p&gt;The Plausibility Trap means that LLM generated fictions are dangerous not because they are false, since we are accustomed to human falsehoods. It is mainly dangerous because the confident, authoritative, and linguistically sophisticated manner in which they are presented. This makes them almost impossible to distinguish from rigorously researched information. The consequences of this trap are no longer theoretical; they are leading to direct professional liability. Consider the famous case where lawyers faced court sanctions for submitting legal briefs citing wholly fabricated case law generated by a large language model (The Washington Post, 2023). This liability was further underscored when Deloitte Australia was compelled to issue a partial $290,000 refund to the Australian government for a professional report that contained fabricated academic citations and non-existent court references (Fortune, 2025). Similarly, the ruling against Air Canada for its chatbot citing a non-existent refund policy demonstrates that corporate responsibility extends directly to the machine’s output, proving that automated indifference is now actionable negligence (Evidently AI, 2024).&lt;/p&gt;

&lt;p&gt;The philosophical scrutiny of Frankfurt reveals that the core issue with generative AI is neither malicious intent nor cognitive failure, but an engineered epistemological void. We have successfully built the perfect engine of indifference. The LLM, by design, seeks only the most fluent linguistic path, making it structurally incapable of violating its own mandate of probabilistic coherence, regardless of the output’s correspondence to reality.&lt;/p&gt;

&lt;p&gt;This realization forces three fundamental conclusions for the field of computer science and digital ethics:&lt;/p&gt;

&lt;p&gt;First, we must recalibrate our performance metrics. The industry must shift the focus from metrics based on linguistic sophistication (like perplexity scores or fluency assessments) to those centered on referential integrity and verifiable traceability. Success in AI should be redefined by factual fidelity, not merely plausible language generation.&lt;/p&gt;

&lt;p&gt;Second, the reliance on external interventions like RAG must be seen as a necessary but ultimately insufficient patch. True progress requires integrating intrinsic truth constraints directly into the objective function during the large-scale pre-training process. We must engineer a digital equivalent of an epistemic module, an architectural feature that penalizes not just grammatical error, but factual unaccountability.&lt;/p&gt;

&lt;p&gt;Third, the burden of critical reception now exponentially increases for the human user. As the volume of high fidelity bullshit accelerates, our collective ability to maintain a connection to empirical reality becomes a defining trait of intellectual survival. The Frankfurtian critique demands not just technical solutions, but a widespread cultural commitment to the disciplined pursuit of what is true, regardless of how beautifully the alternative is articulated. The ultimate defense against automated indifference must be renewed human vigilance.&lt;/p&gt;

&lt;p&gt;Alhena AI. (2023). What Are LLM Hallucinations — Examples and Causes (Discussing the false accusation case).&lt;/p&gt;

&lt;p&gt;Evidently AI. (2024). LLM hallucinations and failures: lessons from 5 examples (Citing Air Canada case and fabricated legal citations).&lt;/p&gt;

&lt;p&gt;Fortune. (2025). Deloitte was caught using AI in $290,000 report to help the Australian government crack down on welfare after a researcher flagged hallucinations.&lt;/p&gt;

&lt;p&gt;Frankfurt, H. G. (2005). On Bullshit. Princeton University Press.&lt;/p&gt;

&lt;p&gt;Ho, D. E. et al. (2024). Large Legal Fictions: Profiling Legal Hallucinations in Large Language Models. Stanford University.&lt;/p&gt;

&lt;p&gt;The Washington Post. (2023). Lawyer faces sanctions for using ChatGPT to write court filing (Detailing the New York case of fabricated legal precedent).&lt;/p&gt;

&lt;p&gt;ACL 2025. (2025). Beyond Perception: Evaluating Abstract Visual Reasoning through Multi-Stage Task (MSEval) (Introduces the MSEval metric to verify the correctness of intermediate reasoning steps for enhanced traceability).&lt;/p&gt;

&lt;p&gt;ICLR 2025 Orals. (2025). A Formal Probabilistic Evaluation Framework for LLMs (Proposes a shift from deterministic to statistically guaranteed performance metrics for output reliability and alignment).&lt;/p&gt;

&lt;p&gt;JT-Safe. (2025). Intrinsically Enhancing the Safety and Trustworthiness of LLMs via Contextual Pre-training (arXiv 2510.17918v1) (Discusses engineering intrinsic truth constraints by augmenting pre-training data with world context and safety attributes).&lt;/p&gt;

&lt;p&gt;PBS News. (2025). Musk’s AI company scrubs posts after Grok chatbot makes comments praising Hitler (Details how Grok’s unfiltered output created controversial results, highlighting the increased demand for human vigilance).&lt;/p&gt;

&lt;p&gt;xAI. (2025). Grok 3 Beta — The Age of Reasoning Agents (xAI News) (Announces Grok 3’s advanced reasoning, “Think” Mode, and DeepSearch features designed for the synthesis of conflicting information).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://www.linkedin.com/pulse/why-ai-hallucinations-worse-than-lies-frankfurts-theory-ercan-canhasi-whsxf/" rel="noopener noreferrer"&gt;&lt;em&gt;https://www.linkedin.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>philosophy</category>
      <category>llm</category>
      <category>aiethics</category>
    </item>
  </channel>
</rss>
