Repository navigation
Expand file tree
/
Copy pathARS_XAI_Eng.tex
More file actions
1224 lines (1018 loc) · 51.9 KB
/
Copy pathARS_XAI_Eng.tex
File metadata and controls
1224 lines (1018 loc) · 51.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\documentclass[
12pt,
a4paper,
oneside,
titlepage
]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{geometry}
\geometry{a4paper, left=3cm, right=3cm, top=3cm, bottom=3cm}
\usepackage{setspace}
\onehalfspacing
\usepackage{parskip}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{microtype}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{url}
\usepackage{natbib}
\usepackage{titling}
% Listing-Style for Python
\lstset{
language=Python,
basicstyle=\ttfamily\small,
keywordstyle=\color{blue},
commentstyle=\color{green!40!black},
stringstyle=\color{red},
showstringspaces=false,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
frame=single,
backgroundcolor=\color{gray!5},
tabsize=2,
captionpos=b
}
% Title
\title{\Huge\textbf{Between Interpretation and Computation} \\
\LARGE Algorithmic Recursive Sequence Analysis as a Bridge \\
\LARGE between Qualitative Hermeneutics and Formal Modeling}
\author{
\large
\begin{tabular}{c}
Paul Koop
\end{tabular}
}
\date{\large June/July 1994 \& 2024}
\begin{document}
\maketitle
\begin{abstract}
Qualitative social research currently faces a methodological dilemma: On one hand,
generative AI systems promise an unprecedented scaling of interpretive work steps;
on the other hand, due to their stochastic nature, they elude the classical validation
logic of qualitative research. This paper argues that this dilemma can be resolved by
revisiting formalizing approaches that were already present in the tradition of text
analysis but were forgotten due to recent developments in generative AI. As a concrete
solution, the paper develops \textbf{Algorithmic Recursive Sequence Analysis (ARS)},
a procedure that transforms interpretive processes into a formal grammar, making them
transparent, reproducible, and intersubjectively verifiable. The connection to current
discussions on \textbf{Explainable AI (XAI)} proves to be doubly fruitful: It provides
a conceptual framework to reflect on the quality of qualitative interpretations and
reminds us that explainability is not a luxury but a necessity—in technology as well
as in science. The empirical application to eight transcripts of sales conversations
demonstrates the effectiveness of the procedure.
\end{abstract}
\newpage
\tableofcontents
\newpage
\section{Introduction: The Paradox of Qualitative Research in the Age of Generative AI}
Qualitative social research currently faces a methodological dilemma. On one hand,
generative AI systems promise an unprecedented scaling of interpretive work steps.
On the other hand, due to their stochastic nature, these systems elude the classical
validation logic of qualitative research. Where the latter traditionally relies on
detailed disclosure of the coding process and intersubjective comprehensibility,
there is now a blind reliance on the supposed \enquote{emergence} of neural networks.
This trend is problematic because it decouples computer-assisted text analysis from
its methodological foundations. At the same time, however, it points to a deficit
that affects qualitative research itself: It lacks a formalized vocabulary to make
its interpretive processes accessible to algorithmic procedures. The result is a
choice between two unsatisfactory options: either renouncing scaling or abandoning
methodological control.
This paper argues that this dilemma can be resolved by revisiting formalizing
approaches that were already present in the tradition of text analysis but were
forgotten due to recent developments in generative AI. As a concrete solution, the
paper develops \textbf{Algorithmic Recursive Sequence Analysis (ARS)}, a procedure
that transforms interpretive processes into a formal grammar, making them transparent,
reproducible, and intersubjectively verifiable.
The point of this approach lies in its connection to current discussions on
\textbf{Explainable Artificial Intelligence (XAI)} . XAI has developed as a response
to the opacity of neural networks \citep{Samek2019, BarredoArrieta2020}. The central
insight is: Those who cannot comprehend the decisions of complex AI systems cannot
trust them—and should not use them in safety-critical areas \citep{Weller2019}. This
insight, so the thesis of this paper, can be productively applied to qualitative
research: It also needs procedures that make its interpretive processes explainable.
ARS understands itself as such a procedure—as a contribution to an \textbf{explainable
qualitative research} that preserves the methodological standards of the discipline
while simultaneously opening up to algorithmic modeling.
The paper is structured as follows: Section 2 introduces the concept of Explainable
AI and develops the analogy to qualitative research. Section 3 presents ARS in its
methodological architecture. Section 4 documents the empirical application to eight
transcripts of sales conversations. Section 5 reflects on the results in light of
the XAI discussion. Section 6 draws a conclusion and outlines perspectives.
\section{Explainable AI: Concept, Development, and Methodological Relevance}
\subsection{Origins and Fundamental Ideas of XAI}
The development of Explainable Artificial Intelligence (XAI) is closely linked to the
realization that the increasing performance of complex AI models comes with a loss of
transparency. In particular, deep neural networks, which achieve impressive results
in numerous application domains, operate as \enquote{black boxes}: Their internal
decision processes are not directly comprehensible to developers or users
\citep[ p.~2]{Samek2019}.
This opacity becomes problematic when AI systems are used in safety-critical areas—in
medical diagnostics, jurisprudence, finance, or autonomous control
\citep[ p.~80800]{Ortigossa2024}. Wrong decisions can have serious consequences here.
At the same time, the opacity of the models makes it difficult to identify bias and
discrimination. A frequently cited case is the COMPAS system for recidivism prediction,
which systematically disadvantaged African American defendants without this bias being
recognizable from the model architecture \citep[ p.~84]{BarredoArrieta2020}.
XAI research responds to this problem by developing methods to subsequently explain
the decisions of complex models or to design interpretable models from the outset
\citep{Mersha2024}. The term \enquote{Explainable AI} itself originates from an
initiative of the US research agency DARPA, which from 2015 onwards specifically
funded projects on the explainability of AI systems \citep[ p.~86]{BarredoArrieta2020}.
Since then, XAI has developed into an independent research field addressing both
technical and ethical as well as legal questions.
An important legal driver of the XAI discussion was the European General Data Protection
Regulation (GDPR). In particular, Recital 71 is often interpreted in research as the
basis of a \enquote{right to explanation}, even though the regulation does not formulate
an explicit, enforceable right to complete algorithmic disclosure \citep{Wachter2017}.
Nevertheless, the GDPR establishes binding requirements for transparency,
comprehensibility, and information obligations in automated decisions, thereby
reinforcing the normative pressure to develop explainable AI systems.
\subsection{Central Concepts and Taxonomies}
The XAI literature has developed a series of concepts and distinctions to structure
the field. \textbf{Explainability} generally denotes the property of an AI system to
present its decisions in a way that is understandable to humans
\citep[ p.~89]{BarredoArrieta2020}. \textbf{Interpretability} aims at enabling a
human observer to comprehend the functioning of the system \citep[ p.~25]{Weller2019}.
\textbf{Transparency} means the disclosure of systemic processes and design decisions
\citep[ p.~27]{Weller2019}.
A fundamental taxonomic distinction concerns the timing of explainability:
\textbf{Ad-hoc methods} (also \enquote{Explanation by Design}) integrate explainability
into the model architecture from the beginning. They design models that are
principally interpretable due to their structure—such as decision trees or rule-based
systems. \textbf{Post-hoc methods}, on the other hand, apply explanation techniques
to already trained black-box models. They attempt to retrospectively reconstruct
which input factors were decisive for a particular decision
\citep[ p.~92]{BarredoArrieta2020}.
A second distinction concerns the scope of explanation: \textbf{Global explanations}
target the overall behavior of the model—they answer the question of how the model
fundamentally functions. \textbf{Local explanations}, on the other hand, refer to
individual decisions—they explain why a specific input led to a specific output
\citep[ p.~80805]{Ortigossa2024}.
A third distinction concerns methodology: \textbf{Model-specific procedures} are only
applicable to certain model architectures (e.g., neural networks). \textbf{Model-agnostic
procedures}, on the other hand, can be used independently of the concrete model
architecture \citep[ p.~3]{Mersha2024}.
Among the best-known XAI procedures are:
\begin{itemize}
\item \textbf{LIME (Local Interpretable Model-agnostic Explanations)}: A
model-agnostic procedure that learns simple, interpretable local surrogate models
to explain the decisions of complex black-box models
\citep[ p.~102]{BarredoArrieta2020}.
\item \textbf{SHAP (SHapley Additive exPlanations)}: A procedure based on
cooperative game theory that quantifies the contribution of each input feature
to a prediction \citep[ p.~104]{BarredoArrieta2020}.
\item \textbf{Saliency Maps}: Visualizations that show for image classifiers
which image regions were particularly relevant for a decision \citep{Zhou2019}.
\item \textbf{Layer-wise Relevance Propagation (LRP)}: A procedure that
propagates the prediction of a neural network backwards layer by layer, thus
identifying relevant input regions \citep{Montavon2019}.
\end{itemize}
\subsection{XAI as a Methodological Challenge}
The XAI discussion is not limited to technical procedures. It touches on fundamental
methodological questions: What does it mean to \enquote{explain} a decision? Who is
the addressee of the explanation? What quality criteria apply to explanations?
NIST (National Institute of Standards and Technology) has formulated three fundamental
properties of good explanations \citep[ p.~80810]{Ortigossa2024}:
\begin{enumerate}
\item \textbf{Meaningfulness}: Explanations must be understandable to the intended
addressee. This requires adaptation to their prior knowledge and cognitive abilities.
\item \textbf{Accuracy}: Explanations must correctly represent the actual decision
processes of the model. There is a potential conflict of goals with meaningfulness:
An accurate but highly complex explanation may be incomprehensible; a comprehensible
but inaccurate explanation may be misleading.
\item \textbf{Knowledge Limits}: Good explanations make clear under which conditions
the model works reliably and where its limits lie.
\end{enumerate}
These criteria are relevant not only for technical systems. They can, as this paper
argues, be transferred to qualitative research. Qualitative interpretations must also
be understandable (for the scientific community), accurate (in the sense of fidelity
to the text), and state their limits (e.g., regarding the scope of interpretation).
The XAI discussion thus provides a conceptual framework to reflect on the quality of
qualitative interpretations—and to develop procedures that ensure this quality.
\subsection{From XAI to Explainable Qualitative Research: An Analogy}
The transfer of the XAI perspective to qualitative research is based on an analogy
systematized in Table~\ref{tab:analogy}:
\begin{table}[h]
\centering
\caption{Analogy between Technical XAI and Qualitative Research}
\label{tab:analogy}
\begin{tabular}{@{} p{2.5cm} p{5cm} p{5cm} @{}}
\toprule
\textbf{Dimension} & \textbf{Technical XAI} & \textbf{Qualitative Research} \\
\midrule
Problem & Opaque decisions of neural networks & Opaque interpretation processes \\
Cause & Subsymbolic representations & Implicit rule knowledge \\
Consequence & Lack of trust, undetected bias & Lack of intersubjectivity \\
Solution & Explication of decision bases & Explication of interpretation rules \\
Methods & LIME, SHAP, Saliency Maps & ARS, explicit category formation \\
Criteria & Meaningfulness, Accuracy, Knowledge Limits & Comprehensibility, Text fidelity, Scope \\
\bottomrule
\end{tabular}
\end{table}
The point of this analogy lies in the reversal of perspective: While XAI asks how to
explain the decisions of \textit{technical} systems, explainable qualitative research
asks how to make the interpretation processes of \textit{human} researchers explainable.
In both cases, it is about transforming implicit, opaque operations into explicit,
comprehensible rules.
Algorithmic Recursive Sequence Analysis, presented in the following, understands
itself as a procedure that accomplishes this transformation. It formalizes
interpretation processes without automating them. It produces explicit, verifiable
models without eliminating hermeneutic openness. And it thus creates the prerequisites
for a qualitatively substantial but methodologically controlled use of algorithmic
procedures.
\section{Algorithmic Recursive Sequence Analysis: Methodological Architecture}
\subsection{Basic Operations: From Transcription to Terminal Symbol String}
ARS operates on transcripts of natural interactions. The first step consists of a
detailed sequential analysis following the logic of qualitative interpretation.
Qualitative sequence analysis, as developed in objective hermeneutics
\citep{Oevermann1979} and conversation analysis \citep{Sacks1974}, aims to uncover
the latent meaning structure of interactions through the systematic reconstruction
of their sequential order. Each speech act is analyzed with regard to its sequential
function and its intentional quality.
The analysis follows the principle of \textbf{interpretation production and falsification}
\citep[ p.~392]{Oevermann1979}: For each sequential step, alternative interpretation
possibilities are generated and systematically tested against the further course of
the interaction. This procedure of \enquote{controlled interpretation}
\citep[ p.~158]{Flick2019} ensures intersubjective comprehensibility and forces the
explication of interpretation rules.
The result of this interpretive work is a \textbf{terminal symbol string}, in which
each speech act is represented by a symbol from a previously developed category system.
These terminal symbols function as a formalized equivalent of qualitative coding
\citep[ p.~207]{Przyborski2021}. The following table illustrates this using an example
from a transcript:
\begin{table}[h]
\centering
\caption{Example of Terminal Symbol Assignment}
\label{tab:terminal}
\begin{tabular}{@{} p{6cm} c p{4cm} @{}}
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} & \textbf{Interpretation} \\
\midrule
Customer: Good day & KBG & Customer greeting (initiation of interaction) \\
Salesperson: Good day & VBG & Salesperson greeting (reciprocal confirmation) \\
Customer: One portion of coarse liver sausage, please. & KBBd & Customer need (articulation of purchase desire) \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Grammar Induction: From Individual Cases to Generative Models}
Based on the terminal symbol strings, an individual grammar is induced for each
transcript. This grammar specifies which sequence patterns are observable in the
respective transcript and which transitions between terminal symbols are possible.
Formally, it is a transition-based grammar operating at the level of terminal symbols,
whose production rules are based on observed transition frequencies.
Unlike classical linguistic PCFGs \citep{Manning1999}, ARS dispenses with explicit
non-terminals and deep recursive derivations. Instead, the grammar models sequential
regularities as probabilistic transitions between formalized speech act categories.
The term grammar is used here in a methodological, not a strictly formal-linguistic
sense: as an explicit, generative rule system for reconstructing observable sequence
structures.
Induction is performed by simply counting observed transitions:
\begin{lstlisting}[caption=Counting Transitions between Terminal Symbols]
transitions = {}
for chain in empirical_chains:
for i in range(len(chain) - 1):
start, end = chain[i], chain[i + 1]
if start not in transitions:
transitions[start] = {}
if end not in transitions[start]:
transitions[start][end] = 0
transitions[start][end] += 1
\end{lstlisting}
\subsection{Unification and Optimization}
The individual grammars are merged into a \textbf{unified grammar} covering the
sequence structure of all transcripts. This is subjected to an iterative adjustment
process that gradually increases the agreement of the transition probabilities with
the empirically observed distribution structure. The procedure follows a heuristic
scheme: It generates artificial strings, compares their frequency distribution with
the empirical data, and iteratively adjusts the transition probabilities.
The definition of a start symbol represents a model-theoretic simplification. It
serves to generate syntactically consistent sequences and does not claim to fully
capture the empirical diversity of real conversation openings.
\section{Empirical Application: Eight Transcripts of Sales Conversations}
\subsection{Hypothetical Initial Grammar}
Based on the literature on sales conversations, the following hypothetical grammar
was derived: A sales conversation (VKG) consists of greeting (BG), sales part (VT),
and farewell (AV). The terminal symbols include KBG, VBG, KBBd, VBBd, KBA, VBA, KAE,
VAE, KAA, VAA, KAV, VAV.
\subsection{The Eight Transcripts}
The complete transcripts can be found in Appendix A. They document interactions at
various sales stands at Aachen market square in June/July 1994.
\subsection{Terminal Symbol Strings}
Since sales conversations can empirically begin with different speech acts, a uniform
start symbol was defined for the generation of artificial sequences. This decision
serves exclusively model consistency and does not affect the transition structure of
the grammar.
The terminal symbol strings formed from the transcripts are fully documented in
Appendix A.
\subsection{Python Implementation}
The complete Python program for grammar induction and optimization can be found in
Appendix B. It implements the steps described in Section 3 and visualizes the
optimization process.
\subsection{Results of Iterative Adjustment}
The optimized grammar exhibits the following structure:
\begin{table}[h]
\centering
\caption{Optimized Transition Probabilities}
\label{tab:results}
\begin{tabular}{@{} l l @{}}
\toprule
\textbf{Start Symbol} & \textbf{Following Symbols with Probabilities} \\
\midrule
KBG & VBG (0.67), VBBd (0.33) \\
VBG & KBBd (1.0) \\
KBBd & VBBd (0.67), VAA (0.17), VBA (0.17) \\
VBBd & KBA (0.44), VAA (0.22), KBBd (0.22), KAA (0.11) \\
KBA & VBA (0.5), VAA (0.5) \\
VBA & KBBd (0.5), KAE (0.25), VAA (0.25) \\
VAA & KAA (0.86), KAV (0.14) \\
KAA & VAV (0.75), VBG (0.25) \\
VAV & KAV (1.0) \\
KAE & VAE (1.0) \\
VAE & KAA (1.0) \\
KAV & KBBd (1.0) \\
\bottomrule
\end{tabular}
\end{table}
In the validation phase, where a larger number of artificial sequences (n = 100) were
generated based on the optimized transition structure, there is a near-perfect
agreement between empirical and generated frequencies (r = 0.9999; p < 0.001).
This high agreement is not to be understood as predictive performance or proof of
generalization. Rather, it documents the structural reproducibility of the empirically
observed transition patterns using the same grammar with an enlarged sample. At the
same time, it must be methodologically reflected that the Pearson correlation
coefficient for frequency vectors with constant sum (1.0) tends to yield high values.
The correlation observed here therefore primarily confirms the internal consistency
of the procedure, less an external validity in the sense of predictive power
\citep[ p.~489]{Flick2019}.
During the iterative optimization phase, the correlation remains stable at about
r ≈ 0.92, which already indicates a high structural fit of the induced grammar. The
further increase in correlation during validation is due to the larger sample of
generated sequences with unchanged transition structure.
\section{Discussion: ARS as a Contribution to Explainable Qualitative Research}
\subsection{ARS and the XAI Criteria}
ARS fulfills the three NIST criteria for good explanations in a form adapted to
qualitative research:
\textbf{Meaningfulness} is ensured through explicit category formation. The terminal
symbols are semantically meaningful (KBG = customer greeting) and remain tied to the
interpretive exploration. A third researcher can comprehend which assignments were
made. This corresponds to the principle of \enquote{communicative validation} central
to qualitative research \citep[ p.~328]{Flick2019}.
\textbf{Accuracy} is operationalized here in the sense of structural fit, not in the
sense of predictive validity. The high agreement between empirical and generated
frequencies shows that the grammar precisely reproduces the observed distribution
structure of the data. In the terminology of qualitative research, one could speak
of \enquote{appropriateness to the subject matter} \citep[ p.~34]{Przyborski2021}.
\textbf{Knowledge Limits} are marked by documenting the production and falsification
of interpretations. The grammar does not claim to capture the \enquote{true} structure
of the interaction but reconstructs observable regularities based on interpretive
decisions. It thus makes its own contingency visible—a methodological virtue discussed
in qualitative research under the keyword \enquote{reflexivity} \citep[ p.~129]{Flick2019}.
\subsection{Ad-hoc vs. Post-hoc: ARS as Explanation by Design}
In XAI terminology, ARS is to be classified as an \textbf{ad-hoc procedure}
(Explanation by Design). It does not design the grammar as a subsequent explanation
of an already existing model but integrates explainability into the modeling process
from the beginning. The terminal symbols are not black boxes but explicate the
interpretive decisions. The transition probabilities are not opaque weights but
simple relative frequencies.
This fundamentally distinguishes ARS from post-hoc procedures that attempt to
subsequently explain the decisions of neural networks. While these procedures can
only provide approximate insights into a principally opaque architecture, ARS is
designed to be transparent from the ground up.
\subsection{Limits of the Analogy}
The analogy between XAI and qualitative research has limits that must be reflected
upon. \textbf{First}, XAI primarily aims at explaining \textit{technical} systems,
while qualitative research is about the explication of \textit{human} interpretation
processes. The causality is different: In XAI, we explain why an algorithm made a
particular decision; in ARS, we explain how researchers arrived at a particular
interpretation.
\textbf{Second}, XAI operates with a different concept of truth. The explanations
are supposed to correctly represent the actual decision processes of the model. In
ARS, on the other hand, there are no \enquote{actual} processes that exist
independently of interpretation. The grammar is not a discovery but a construction—one
that must, however, prove itself against empirical evidence \citep[ p.~80]{Flick2019}.
\textbf{Third}, the addressee is different. XAI explanations are directed at users,
developers, or regulatory authorities. ARS explanations are directed at the
scientific community of qualitative research. The criteria for meaningfulness must
therefore be adapted to their specific discourse practice.
\subsection{Methodological Implications}
Despite these limits, the XAI perspective opens up productive questions for
qualitative research: How can we explicate our interpretation processes so that
they become comprehensible to others? What formats of explication are suitable?
How can we not only claim but demonstrate the quality of our interpretations?
ARS provides a concrete answer to these questions. It formalizes interpretation
processes without automating them. It makes interpretive decisions explicit without
eliminating hermeneutic openness. It thus creates the prerequisites for a
methodologically reflected use of algorithmic procedures in qualitative research.
\section{Conclusion and Outlook}
Qualitative social research faces the challenge of using the possibilities of
algorithmic text analysis without sacrificing its methodological standards.
Algorithmic Recursive Sequence Analysis offers a way to productively address this
challenge. It formalizes interpretation processes without automating them. It
produces explicit, verifiable models without eliminating hermeneutic openness.
The connection to the XAI discussion proves doubly fruitful: It provides a conceptual
framework to reflect on the quality of qualitative interpretations. And it reminds
us that explainability is not a luxury but a necessity—in technology as well as in
science.
Further research could develop ARS in several directions: through the integration
of additional formal modeling methods (Petri nets, Bayesian networks), through more
systematic connection with computational linguistics methods, or through application
to other types of interaction. What remains crucial is always methodological control:
The formal procedures must respect the interpretive character of the analysis and
must not lead to its automation.
\newpage
\begin{thebibliography}{99}
\bibitem[Barredo Arrieta et al.(2020)]{BarredoArrieta2020}
Barredo Arrieta, A., Díaz-Rodríguez, N., Del Ser, J., Bennetot, A., Tabik, S.,
Barbado, A., Garcia, S., Gil-Lopez, S., Molina, D., Benjamins, R., Chatila, R.,
\& Herrera, F. (2020). Explainable Artificial Intelligence (XAI): Concepts,
taxonomies, opportunities and challenges toward responsible AI.
\textit{Information Fusion}, 58, 82-115.
\bibitem[Flick(2019)]{Flick2019}
Flick, U. (2019). \textit{An Introduction to Qualitative Research} (7th ed.).
Sage Publications.
\bibitem[Manning \& Schütze(1999)]{Manning1999}
Manning, C. D., \& Schütze, H. (1999). \textit{Foundations of Statistical Natural
Language Processing}. MIT Press.
\bibitem[Mersha et al.(2024)]{Mersha2024}
Mersha, M., et al. (2024). Explainable Artificial Intelligence: A Survey of Needs,
Techniques, Applications, and Future Direction. \textit{Neurocomputing}, 599, 128111.
\bibitem[Montavon et al.(2019)]{Montavon2019}
Montavon, G., Binder, A., Lapuschkin, S., Samek, W., \& Müller, K.-R. (2019).
Layer-Wise Relevance Propagation: An Overview. In W. Samek, G. Montavon,
A. Vedaldi, L. K. Hansen, \& K.-R. Müller (Eds.), \textit{Explainable AI:
Interpreting, Explaining and Visualizing Deep Learning} (pp. 193-210). Springer.
\bibitem[Oevermann et al.(1979)]{Oevermann1979}
Oevermann, U., Allert, T., Konau, E., \& Krambeck, J. (1979). The methodology of
objective hermeneutics and its general research-logical significance in the social
sciences. In H.-G. Soeffner (Ed.), \textit{Interpretive Procedures in the Social
and Text Sciences} (pp. 352-434). Metzler.
\bibitem[Ortigossa et al.(2024)]{Ortigossa2024}
Ortigossa, E. S., Gonçalves, T., \& Nonato, L. G. (2024). EXplainable Artificial
Intelligence (XAI)—From Theory to Methods and Applications. \textit{IEEE Access},
12, 80799-80846.
\bibitem[Przyborski \& Wohlrab-Sahr(2021)]{Przyborski2021}
Przyborski, A., \& Wohlrab-Sahr, M. (2021). \textit{Qualitative Social Research:
A Workbook} (5th ed.). De Gruyter Oldenbourg. [German original: \textit{Qualitative
Sozialforschung: Ein Arbeitsbuch}]
\bibitem[Sacks et al.(1974)]{Sacks1974}
Sacks, H., Schegloff, E. A., \& Jefferson, G. (1974). A simplest systematics for
the organization of turn-taking for conversation. \textit{Language}, 50(4), 696-735.
\bibitem[Samek \& Müller(2019)]{Samek2019}
Samek, W., \& Müller, K.-R. (2019). Towards Explainable Artificial Intelligence.
In W. Samek, G. Montavon, A. Vedaldi, L. K. Hansen, \& K.-R. Müller (Eds.),
\textit{Explainable AI: Interpreting, Explaining and Visualizing Deep Learning}
(pp. 1-10). Springer.
\bibitem[Wachter et al.(2017)]{Wachter2017}
Wachter, S., Mittelstadt, B., \& Floridi, L. (2017). Why a right to explanation
of automated decision-making does not exist in the general data protection
regulation. \textit{International Data Privacy Law}, 7(2), 76-99.
\bibitem[Weller(2019)]{Weller2019}
Weller, A. (2019). Transparency: Motivations and Challenges. In W. Samek,
G. Montavon, A. Vedaldi, L. K. Hansen, \& K.-R. Müller (Eds.),
\textit{Explainable AI: Interpreting, Explaining and Visualizing Deep Learning}
(pp. 23-40). Springer.
\bibitem[Zhou et al.(2019)]{Zhou2019}
Zhou, B., Bau, D., Oliva, A., \& Torralba, A. (2019). Comparing the Interpretability
of Deep Networks via Network Dissection. In W. Samek, G. Montavon, A. Vedaldi,
L. K. Hansen, \& K.-R. Müller (Eds.), \textit{Explainable AI: Interpreting,
Explaining and Visualizing Deep Learning} (pp. 239-252). Springer.
\end{thebibliography}
\newpage
\appendix
\section{The Eight Transcripts with Terminal Symbols}
\subsection{Transcript 1 - Butcher Shop}
\textbf{Date:} June 28, 1994, \textbf{Location:} Butcher Shop, Aachen, 11:00 AM
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 1 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer: Good day & KBG \\
Salesperson: Good day & VBG \\
Customer: One portion of coarse liver sausage, please. & KBBd \\
Salesperson: How much would you like? & VBBd \\
Customer: Two hundred grams. & KBA \\
Salesperson: Two hundred grams. Anything else? & VBA \\
Customer: Yes, then a piece of Black Forest ham. & KBBd \\
Salesperson: How large should the piece be? & VBBd \\
Customer: Around three hundred grams. & KBA \\
Salesperson: That will be eight marks twenty. & VAA \\
Customer: Here you are. & KAA \\
Salesperson: Thank you and have a nice day! & VAV \\
Customer: Thanks, you too! & KAV \\
\end{longtable}
\textbf{Terminal Symbol String 1:} KBG, VBG, KBBd, VBBd, KBA, VBA, KBBd, VBBd, KBA, VAA, KAA, VAV, KAV
\subsection{Transcript 2 - Marketplace (Cherries)}
\textbf{Date:} June 28, 1994, \textbf{Location:} Marketplace, Aachen
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 2 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Salesperson: Everyone can try cherries here, everyone can try cherries here! & VBG \\
Customer 1: Half a kilo of cherries, please. & KBBd \\
Salesperson: Half a kilo? Or a kilo? & VBBd \\
Salesperson: Three marks, please. & VAA \\
Customer 1: Thank you! & KAA \\
Salesperson: Everyone can try cherries here! & VBG \\
Customer 2: Half a kilo, please. & KBBd \\
Salesperson: Three marks, please. & VAA \\
Customer 2: Thank you! & KAA \\
\end{longtable}
\textbf{Terminal Symbol String 2:} VBG, KBBd, VBBd, VAA, KAA, VBG, KBBd, VAA, KAA
\subsection{Transcript 3 - Fish Stand}
\textbf{Date:} June 28, 1994, \textbf{Location:} Fish Stand, Marketplace, Aachen
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 3 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer: One pound of saithe, please. & KBBd \\
Salesperson: Saithe, alright. & VBBd \\
Salesperson: Four marks nineteen, please. & VAA \\
Customer: Thank you! & KAA \\
\end{longtable}
\textbf{Terminal Symbol String 3:} KBBd, VBBd, VAA, KAA
\subsection{Transcript 4 - Vegetable Stand (Detailed)}
\textbf{Date:} June 28, 1994, \textbf{Location:} Vegetable Stand, Marketplace, Aachen, 11:00 AM
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 4 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer: Listen, I'll take some mushrooms. & KBBd \\
Salesperson: Brown or white? & VBBd \\
Customer: Let's take the white ones. & KBA \\
Salesperson: They're both fresh, don't worry. & VBA \\
Customer: What about chanterelles? & KBBd \\
Salesperson: Ah, they're great! & VBA \\
Customer: Can I put them in rice salad? & KAE \\
Salesperson: Better sauté them briefly in a pan. & VAE \\
Customer: Okay, I'll do that. & KAA \\
Salesperson: Have a nice day! & VAV \\
Customer: You too! & KAV \\
\end{longtable}
\textbf{Terminal Symbol String 4:} KBBd, VBBd, KBA, VBA, KBBd, VBA, KAE, VAE, KAA, VAV, KAV
\subsection{Transcript 5 - Vegetable Stand (with KAV at beginning)}
\textbf{Date:} June 26, 1994, \textbf{Location:} Vegetable Stand, Marketplace, Aachen, 11:00 AM
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 5 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer 1: Goodbye! & KAV \\
Customer 2: I'd like a kilo of Granny Smith apples here. & KBBd \\
Salesperson: Anything else? & VBBd \\
Customer 2: Yes, another kilo of onions. & KBBd \\
Salesperson: Six marks twenty-five, please. & VAA \\
Customer 2: Goodbye! & KAV \\
\end{longtable}
\textbf{Terminal Symbol String 5:} KAV, KBBd, VBBd, KBBd, VAA, KAV
\subsection{Transcript 6 - Cheese Stand}
\textbf{Date:} June 28, 1994, \textbf{Location:} Cheese Stand, Marketplace, Aachen
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 6 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer 1: Good morning! & KBG \\
Salesperson: Good morning! & VBG \\
Customer 1: I'd like five hundred grams of Dutch Gouda. & KBBd \\
Salesperson: As a piece? & VBBd \\
Customer 1: Yes, as a piece, please. & KAA \\
\end{longtable}
\textbf{Terminal Symbol String 6:} KBG, VBG, KBBd, VBBd, KAA
\subsection{Transcript 7 - Candy Stand}
\textbf{Date:} June 28, 1994, \textbf{Location:} Candy Stand, Marketplace, Aachen, 11:30 AM
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 7 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer: I'd like one hundred grams of the mixed ones. & KBBd \\
Salesperson: For home or to take away? & VBBd \\
Customer: To take away, please. & KBA \\
Salesperson: Fifty pfennigs, please. & VAA \\
Customer: Thanks! & KAA \\
\end{longtable}
\textbf{Terminal Symbol String 7:} KBBd, VBBd, KBA, VAA, KAA
\subsection{Transcript 8 - Bakery}
\textbf{Date:} July 9, 1994, \textbf{Location:} Bakery, Aachen, 12:00 PM
\begin{longtable}{@{} p{8cm} c @{}}
\caption{Transcript 8 - Terminal Symbols}\\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endfirsthead
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{Transcript Excerpt} & \textbf{Terminal Symbol} \\
\midrule
\endhead
\midrule \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
Customer: Good day! & KBG \\
Salesperson: One portion of our best coffee, freshly ground, please. & VBBd \\
Customer: Yes, also two pieces of fruit salad and a small cup of cream. & KBBd \\
Salesperson: Alright! & VBA \\
Salesperson: That will be fourteen marks and nineteen pfennigs, please. & VAA \\
Customer: I'll pay in small change. & KAA \\
Salesperson: Thank you very much, have a nice Sunday! & VAV \\
Customer: Thanks, you too! & KAV \\
\end{longtable}
\textbf{Terminal Symbol String 8:} KBG, VBBd, KBBd, VBA, VAA, KAA, VAV, KAV
\newpage
\section{Complete Python Implementation}
\begin{lstlisting}[caption=Algorithmic Recursive Sequence Analysis 2.0 - Complete Code]
"""
Algorithmic Recursive Sequence Analysis 2.0
Grammar Induction from Eight Transcripts
Optimization through Iterative Comparison of Empirical and Generated Strings
"""
import numpy as np
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
from tabulate import tabulate
# ============================================================================
# 1. EMPIRICAL DATA: Terminal symbol strings from eight transcripts
# ============================================================================
empirical_chains = [
# Transcript 1: Butcher Shop
['KBG', 'VBG', 'KBBd', 'VBBd', 'KBA', 'VBA', 'KBBd', 'VBBd', 'KBA', 'VAA', 'KAA', 'VAV', 'KAV'],
# Transcript 2: Marketplace (Cherries)
['VBG', 'KBBd', 'VBBd', 'VAA', 'KAA', 'VBG', 'KBBd', 'VAA', 'KAA'],
# Transcript 3: Fish Stand
['KBBd', 'VBBd', 'VAA', 'KAA'],
# Transcript 4: Vegetable Stand (detailed)
['KBBd', 'VBBd', 'KBA', 'VBA', 'KBBd', 'VBA', 'KAE', 'VAE', 'KAA', 'VAV', 'KAV'],
# Transcript 5: Vegetable Stand (with KAV at beginning)
['KAV', 'KBBd', 'VBBd', 'KBBd', 'VAA', 'KAV'],
# Transcript 6: Cheese Stand
['KBG', 'VBG', 'KBBd', 'VBBd', 'KAA'],
# Transcript 7: Candy Stand
['KBBd', 'VBBd', 'KBA', 'VAA', 'KAA'],
# Transcript 8: Bakery
['KBG', 'VBBd', 'KBBd', 'VBA', 'VAA', 'KAA', 'VAV', 'KAV']
]
# ============================================================================
# 2. TRANSITION COUNTING AND INITIAL PROBABILITIES
# ============================================================================
def count_transitions(chains):
"""Counts transitions between terminal symbols in all chains"""
transitions = {}
for chain in chains:
for i in range(len(chain) - 1):
start, end = chain[i], chain[i + 1]
if start not in transitions:
transitions[start] = {}
if end not in transitions[start]:
transitions[start][end] = 0
transitions[start][end] += 1
return transitions
def calculate_probabilities(transitions):
"""Normalizes transition counts to probabilities"""
probabilities = {}
for start in transitions:
total = sum(transitions[start].values())
probabilities[start] = {end: count / total
for end, count in transitions[start].items()}
return probabilities
# Initial calculations
initial_transitions = count_transitions(empirical_chains)
initial_probabilities = calculate_probabilities(initial_transitions)
print("=" * 70)
print("ALGORITHMIC RECURSIVE SEQUENCE ANALYSIS 2.0")
print("=" * 70)
print("\n1. INITIAL TRANSITION PROBABILITIES (FROM EMPIRICAL DATA)")
print("-" * 70)
for start in sorted(initial_probabilities.keys()):
transitions_str = ", ".join([f"{end}: {prob:.3f}"
for end, prob in initial_probabilities[start].items()])
print(f"{start} -> {transitions_str}")
# ============================================================================
# 3. TERMINAL SYMBOLS AND START SYMBOL
# ============================================================================
terminal_symbols = sorted(list(set([item for sublist in empirical_chains
for item in sublist])))
start_symbol = empirical_chains[0][0] # KBG as start (can be adjusted)
print(f"\nTerminal symbols ({len(terminal_symbols)}): {terminal_symbols}")
print(f"Start symbol: {start_symbol}")
# ============================================================================
# 4. GENERATION OF ARTIFICIAL CHAINS
# ============================================================================
def generate_chain(probabilities, start_symbol, max_length=20):
"""Generates a chain based on transition probabilities"""
chain = [start_symbol]
current = start_symbol
for _ in range(max_length - 1):
if current not in probabilities:
break
next_symbols = list(probabilities[current].keys())
probs = list(probabilities[current].values())
# If no following symbols exist, break
if not next_symbols:
break
next_symbol = np.random.choice(next_symbols, p=probs)
chain.append(next_symbol)
current = next_symbol
# Stop if we land at a terminal without further transitions
if current not in probabilities:
break
return chain
def generate_multiple_chains(probabilities, start_symbol, n_chains=8, max_length=20):
"""Generates multiple chains"""
return [generate_chain(probabilities, start_symbol, max_length)
for _ in range(n_chains)]
# ============================================================================
# 5. FREQUENCY ANALYSIS
# ============================================================================
def compute_frequencies(chains, terminals):
"""Computes relative frequencies of terminal symbols in chains"""
frequency_array = np.zeros(len(terminals))
terminal_index = {term: i for i, term in enumerate(terminals)}
for chain in chains:
for symbol in chain:
if symbol in terminal_index:
frequency_array[terminal_index[symbol]] += 1
total = frequency_array.sum()
if total > 0:
frequency_array /= total # Normalization
return frequency_array
# Empirical frequencies as reference
empirical_frequencies = compute_frequencies(empirical_chains, terminal_symbols)