WeeklyWorker

03.12.2026
Use it

Embrace the future, but carefully

A genuinely useful socialist AI should be able to identify contradictions, examine alternative interpretations and criticise the arguments of the organisation that developed it. Yassamine Mather addressed the CPGB’s November 29 membership aggregate

AI is transforming production, scientific research, political communication and the organisation of knowledge. Socialists need to confront the dangers of this technology, but also understand how it works, how it can be developed by using accessible tools and how it might strengthen working class organisation.

Much of the discussion of artificial intelligence on the left is dominated by fear: unemployment, workplace surveillance, corporate concentration, ideological manipulation and the enormous power accumulated by a handful of technology companies. These concerns are legitimate. AI is already being incorporated into capitalist production and management, often with the explicit objective of reducing labour costs, increasing productivity and strengthening managerial control.

However, criticism alone does not answer a practical question: what can socialists and trade unionists do with this technology now, under existing capitalist conditions? We cannot turn back the clock or simply wish AI away. It exists, it will develop and pretending otherwise makes the left look silly. However, we should not leave its development and application entirely to employers, governments and corporations. The technology is already available, and many of its useful components can be accessed through relatively inexpensive software, including freely available programming languages and libraries.

Our response requires four interconnected activities: understanding how artificial intelligence works; developing tools around existing models; mastering the means of keeping those tools accountable; and applying them to concrete political and organisational problems. Of course, I am not saying that AI is politically neutral or inherently emancipatory. I am suggesting we recognise that technologies developed within capitalist social relations can also become terrains of struggle.

Relatively simple

To understand artificial intelligence, it helps to begin with something relatively simple: how a computer learns basic distinctions. The example often given is the difference between cats and dogs.

Human beings recognise cats and dogs through experience. We learn to identify characteristic features, although we may find it difficult to explain precisely which combination of features allows us to recognise an unfamiliar animal. A computer approaches the problem differently: it must translate the information it receives into numbers. Imagine that we provide a computer with examples of cats and dogs, recording two characteristics for each animal: its weight and the length of its ears. A cat might weigh four kilograms and have ears five centimetres long. These two measurements become numerical inputs.

Of course, such measurements are insufficient for reliably distinguishing cats from dogs. Some dogs are smaller than cats, and some cats are unusually large. Real image-recognition systems work with thousands or millions of numerical values representing pixels and more complex patterns. Nevertheless, the simplified example illustrates the essential principle.

The computer begins with adjustable numerical values called weights. These determine how strongly each input contributes to the result. A simplified artificial neuron (a basic computational unit in an artificial neural network, loosely inspired by the way nerve cells in the human brain process information) multiplies each input by its corresponding weight, adds the results together and includes another adjustable number called the bias. This bias is a mathematical offset that helps determine the neuron’s output, rather than the political or ideological bias we might associate with human judgement.

Suppose the animal weighs four kilograms and has ears five centimetres long. If the first weight is 0.2, the second is 0.1 and the bias is minus one, the calculation becomes: (4 × 0.2) + (5 × 0.1) - 1 = 0.3.

The result, 0.3, is a numerical score. A mathematical function called a sigmoid can convert that score into a value between zero and one. A sigmoid is an S-shaped curve that converts any numerical input into a value between 0 and 1, helping determine how strongly a neuron responds. In this example, the result is approximately 0.574, which we can interpret as a model-assigned probability of 57.4% for the chosen category, say ‘dog’.

This is not a statement of objective certainty. It is the model’s output based on its current numerical settings. The important question is what happens when the computer gets the answer wrong. During training, the correct category is already known. The computer compares its prediction with that answer and calculates an error, called the loss. If the animal is a dog, represented by the number one, and the prediction is 0.574, a simple squared-error calculation gives approximately 0.181.

The computer’s task is to reduce this error by adjusting its weights. This is the essence of machine learning: make a prediction, measure the error, adjust the weights and repeat. How does the computer know which weights to change? One widely used method is called gradient descent. Although the mathematics can become complicated, the underlying idea is straightforward.

Imagine standing on a hillside in thick fog. You cannot see the valley below, but you can determine which direction slopes downward. By taking a small step in that direction, checking the slope again and repeating the process, you may gradually reach a lower point.

Gradient descent follows a similar principle. The system calculates how changing a weight would affect the loss, then makes a small adjustment in the direction expected to reduce it. Suppose a weight is currently 0.20, the calculated gradient is positive 0.50 and the learning rate is 0.10. The learning rate determines how large an adjustment the computer makes.

The updated weight becomes: 0.20 - (0.10 × 0.50) = 0.15. The weight has changed from 0.20 to 0.15. In a real neural network, this process happens across many interconnected artificial neurons. A technique called backpropagation calculates how the different weights contribute to the error, allowing the system to update them efficiently. These adjustments may be repeated millions - or billions - of times.

An important distinction must be made between learning and memorising. A model might perform extremely well on the examples used during training, but fail when presented with unfamiliar examples. This is called overfitting. For that reason, researchers evaluate models using data that were not included in training.

The objective is not simply to remember previous answers, but to recognise patterns that remain useful in new situations. This distinction becomes particularly important when AI is applied to historical research, economic analysis or workplace data. A model that produces convincing interpretations of familiar material may still be unreliable when confronted with new evidence.

Python and NumPy

The mathematics involved in neural networks might appear to require expensive and highly specialised software. In reality, their basic principles can be demonstrated using Python, a widely used programming language that is freely available.

Python is particularly useful, because it allows programmers to combine relatively simple instructions with powerful mathematical libraries. One of the most important is NumPy (short for ‘Numerical Python’). NumPy allows computers to perform mathematical operations on large collections of numbers efficiently. Instead of calculating each multiplication, addition or subtraction separately, it can apply operations to entire arrays. An array is simply an organised collection of numbers. A matrix is a two-dimensional arrangement of numbers, rather like a table with rows and columns.

These structures are fundamental to neural networks, because the information entering a network, its weights and many of its intermediate calculations can all be represented numerically. For example, suppose we have three numbers: 10, 20 and 30. In Python, NumPy can place them in an array, calculate their average or multiply every element by two:

import numpy as np
numbers = np.array([10, 20, 30])
print(np.mean(numbers))
# 20.0
print(numbers * 2)
# [20 40 60]

The first instruction imports NumPy and gives it the shorter name, np. The second creates an array. The function, ‘np.mean ()’, calculates the arithmetic average, while ‘numbers * 2’ multiplies every element by two. This may seem elementary, but the same principle applies when arrays contain millions of numbers.

Rather than writing separate instructions for every calculation, NumPy performs operations on complete numerical structures. It is especially efficient because much of its underlying computation is implemented in optimised compiled code.

The significance becomes clearer when we return to the artificial neuron. We previously calculated its output by multiplying two inputs by two weights and adding a bias. NumPy can perform that calculation using a function called ‘np.dot ()’:

import numpy as np
numbers = np.array([0.2, 0.11])
bias = -1
score = np.dot(inputs, weights) + bias
print(round(score, 2))
# 0.3

Here, np.dot () multiplies corresponding elements and adds the results. The bias is then added.

This is the same calculation we performed manually, but it can be extended to much larger arrays. When a neural network contains thousands of artificial neurons, the calculations can be organised as matrix operations. Each layer receives numerical inputs, combines them with its weights and passes the resulting values to the next layer. A neural network is therefore not a mysterious machine that learns through some unexplained process. At its computational level, it performs repeated numerical operations, although the patterns that emerge from very large networks can be extremely difficult to interpret.

NumPy can also help demonstrate how training changes weights. We can represent the weights as an array and subtract a small adjustment calculated from the gradients:

weights = np.array([0.2, 0.1])
gradients = np.array([0.5, -0.2])
learning_rate = 0.1
weights = weights – learning_rate * gradients
print(weights)
# [0.15 0.12]

The first weight falls from 0.20 to 0.15, while the second rises from 0.10 to 0.12.

In this example, the gradients are supplied rather than calculated. A complete training program would calculate them from the loss function and the network’s structure. Nevertheless, the example shows how a few lines of Python can implement the central operation involved in learning.

More sophisticated libraries, including PyTorch and TensorFlow, built on these numerical principles. They provide automatic differentiation, neural-network components and support for specialised processors such as GPUs. For small educational models, NumPy may be sufficient. For large neural networks, specialised frameworks are generally more practical.

A useful feature of NumPy is that it can save numerical arrays for later use.

For example: ‘np.save (“numbers.npy”, numbers)’. This creates a file with the extension, ‘.npy’. The format preserves the array’s numerical values, data type and shape. NumPy can subsequently load the array without having to recreate it.

The related ‘.npz’ format can store several arrays in one file, while ‘.csv’ files provide a widely compatible text-based format that spreadsheet programs can read. This is relevant to AI development, because neural-network weights, numerical datasets and intermediate results may need to be saved, examined or reused.

Here we need to distinguish this from saving a complete-production AI system. Real models may require additional information about their architecture, configuration and processing methods. NumPy’s file formats are useful for arrays, but they are not automatically complete model packages.

The broader lesson is that the basic mathematics of neural networks is accessible to anyone willing to learn a little Python. One does not need to reproduce the computing infrastructure of Google or OpenAI to understand the operations on which machine learning depends.

Language models

A large language model applies related principles to language rather than animal measurements. Instead of receiving an animal’s weight and ear length, it receives text represented numerically.

The first step is tokenisation. A sentence is divided into units called tokens. A token may represent a whole word, part of a word or punctuation. These tokens are assigned numerical identifiers and converted into learned numerical representations known as embeddings. An embedding represents a token through a collection of numbers. These numerical representations allow a model to capture patterns of linguistic use and relationships between expressions. During pretraining, a language model repeatedly attempts to predict the next token in a sequence. For example, given the words, ‘The cat sat on the’, a model might assign a relatively high probability to ‘mat’, a lower probability to ‘floor’ and a very low probability to an unrelated word.

The model does not consult a dictionary of fixed rules to make this prediction. Its output emerges from the numerical relationships established through training. A function called softmax converts the model’s numerical scores into a probability distribution across possible tokens. The model then selects or samples a token, adds it to the sequence and continues.

Modern language models are vastly more complex than simple word-prediction exercises. They commonly use transformer architectures, which include mechanisms known as ‘attention’. Attention allows the model to take account of relationships between different parts of a sequence. Consider the sentence, ‘She sat by the bank of the river.’ The word ‘bank’ could refer to a financial institution or the side of a river. The surrounding words help establish the intended meaning.

Attention mechanisms allow the model to give different numerical weight to relevant contextual information. They are part of the process through which the model constructs context-sensitive representations. This is important, because language cannot be understood simply by examining isolated words. Meaning depends on relationships, context, history and the wider structure of an argument. However, attention weights should not be confused with a transparent explanation of what a model is thinking. They are mathematical components of a complex computation, not direct evidence of human-like understanding.

Large language models are trained on enormous quantities of text, including books, websites, scientific publications, articles and computer code. Through repeated prediction and correction, they acquire abilities that extend far beyond completing short sentences. They can summarise complicated documents, translate languages, generate computer programs and construct detailed arguments. But a central problem remains: generating plausible language is not the same as verifying factual claims.

A model may produce an invented quotation, an incorrect historical date or a reference to a publication that does not exist. Because the surrounding prose is often fluent and persuasive, such errors can be difficult to identify. These errors are commonly called ‘hallucinations’.

The term is imperfect, but it describes an important practical problem. A model can produce information that appears credible without establishing that it is true. For political and historical research, this is particularly serious. A fabricated quotation attributed to Lenin, Trotsky, Gramsci or Marx might be repeated in an article and subsequently circulated as authentic. Similarly, an invented statistic about unemployment, inflation or military expenditure could distort a political argument. The solution is not to abandon AI-assisted research, but to design systems that connect generated answers to verifiable evidence.

This brings us to retrieval-augmented generation. Usually abbreviated to RAG, this is a method for providing a language model with relevant information from a selected collection of documents. Rather than expecting the model to answer entirely from patterns learned during training, the system searches an archive and supplies relevant passages alongside the question.

Imagine a trade union has accumulated years of workplace reports, collective agreements, company accounts, health and safety records and correspondence. A union representative asks: “What concerns were raised about accidents in the loading bay during the previous year?” A conventional language model might offer a general answer about workplace safety. A retrieval system, however, can search the union’s documents, locate the relevant report and supply the passages that discuss the incidents. The model can then produce a summary with references to the original material.

A well-designed system should also recognise when the archive does not contain the answer. If asked what the board decided about pensions when no relevant records exist, it should report that the available documents do not establish the answer. This ability to acknowledge missing evidence is essential.

RAG systems frequently use numerical representations of documents called ‘embeddings’. The archive is divided into manageable passages, each of which is converted into a numerical representation. When a question arrives, the system represents the question in a comparable form and identifies passages that appear semantically relevant. This process involves numerical operations, including comparisons between vectors. Python libraries, such as NumPy, can help explain the mathematics, while specialised search and vector-database tools handle larger collections.

However, RAG is not a guarantee of accuracy. A system may retrieve the wrong passage, overlook a relevant document, misinterpret a quotation or produce a misleading summary. Its reliability depends on the quality of the archive, the retrieval method, the model and the procedures used to check the answer.

Retrieval-augmented generation is particularly useful when combined with AI ‘agents’. A conventional language model responds to an instruction by generating text. An agent is a larger software system that can use a language model to decide which tools to call, examine the results and continue working towards a specified objective.

For example, an agent investigating the economic effects of sanctions on Iran might be given access to international trade databases, academic publications, statistical software and selected news sources. It could begin by identifying relevant economic indicators, search for data, compare different sources and use Python to calculate changes over time.

If the figures contradict one another, it could investigate whether the disagreement reflected different definitions, reporting periods or methods of estimation. Finally, it could produce a report identifying what is established, what remains uncertain and which interpretations are supported by the evidence. Such an agent would combine language generation with retrieval, numerical analysis and a structured research workflow. Python is especially useful here, because it can connect these different components.

NumPy can perform numerical calculations. Pandas (another Python library for organising, cleaning, analysing and manipulating data) can organise and analyse tabular data. Other libraries can retrieve documents, process text, create visualisations and communicate with external systems.

The language model does not need to perform every operation itself. It can identify which calculation is required, while conventional software performs the arithmetic. This division of labour is important. A model may be good at identifying relevant information and explaining its significance, while being less reliable at complex numerical calculations performed entirely through generated text. The use of established mathematical software reduces some of these risks.

Nevertheless, an agent is not an independent political researcher in the human sense. It does not possess social experience, political accountability or an autonomous understanding of historical processes. Its apparent independence is a product of the workflow, permissions and tools that people have designed. For that reason, agents should be supervised - especially when they can modify documents, contact people, access confidential information or publish material.

Socialist research

Why should the left not develop systems of this kind?

Socialist organisations possess enormous quantities of historical and political material - much of it scattered across archives, journals, websites and private collections. More than a century of Marxist theory, trade union history, economic analysis, revolutionary debates and political experience exists in many languages. Yet access to this material remains uneven. Important documents are difficult to locate, historical publications are poorly indexed, and researchers often repeat work that others have already undertaken. A collective AI research infrastructure could help address these problems.

Imagine an archive containing historical publications of the Communist Party of Great Britain, debates within the international communist movement, including the Fourth International, material from the left in the global south, trade union records and studies of capitalist political economy. A retrieval system could make this material searchable through ordinary language. An agent could then compare positions across different periods, identify changes in political arguments and locate the original sources.

For example, a researcher examining the Iranian revolution could ask how the Tudeh party’s interpretation of the Islamic Republic changed between 1979 and 1983, or how different Fedayeen organisations analysed the relationship between anti-imperialism, class struggle and the state. A properly constructed system could identify relevant publications, arrange them chronologically and compare competing interpretations. It would not settle the historical argument automatically. But it could make the evidence more accessible and reduce the time required for preliminary research.

The same approach could assist translation. A multilingual archive could help researchers identify equivalent political terminology across English, French, German, Russian, Italian, Chinese, Persian, Arabic and other languages, while preserving references to the original texts. Such work could be especially valuable for smaller socialist organisations that lack the resources of universities or large research institutes.

There are several possible approaches to controlling AI systems. One is to use commercial models, while retaining control over the documents, retrieval procedures and tools connected to them. Another is to use open-weight models, whose numerical parameters can be downloaded and run on independently managed computers.

An open-weight model is an artificial intelligence model whose trained parameters, known as weights, are made publicly available. This allows researchers, developers and organisations to download, examine and modify the model, and run it on their own computers or servers. Unlike proprietary AI models, which are generally controlled by the companies that develop them, open-weight models offer greater opportunities for independent adaptation and experimentation. However, open-weight models are not necessarily fully open-source. They differ in how much information they make public and what restrictions they place on their use.

I should explain that open-source software is the opposite of proprietary software, which is controlled by its owners. Open source allows developers and users to understand how it works, improve it and adapt it to their own needs. In artificial intelligence, however, making a model’s weights available does not necessarily mean that its training data, code or development process are also open. Running a model independently can reduce dependence on external services, but it does not eliminate problems of security, reliability or political bias. Bias can enter through the original training data, through the documents selected for retrieval and through the instructions that govern the system’s responses.

A socialist organisation could, for example, construct a model around a carefully selected Marxist archive. This might provide access to material that commercial systems neglect. But it could also create an intellectually closed system that reproduces the assumptions of a single political tradition. The objective should not be to replace corporate ideological restrictions with an automated political orthodoxy. A genuinely useful socialist AI should be capable of identifying contradictions, examining alternative interpretations and criticising the arguments of the organisation that developed it. This requires treating AI as an instrument of inquiry rather than a machine for manufacturing political agreement.

Struggle for control

The wider political question concerns the ownership and deployment of artificial intelligence.

The largest technology companies compete for markets, data, computing infrastructure and skilled labour. Yet the development of AI also depends on publicly funded research, university science, open-source software and the collective work of enormous numbers of programmers, engineers and researchers. The increasingly social character of production exists alongside the private appropriation of its results. This contradiction is familiar to Marxists.

Under capitalism, the introduction of machinery has historically been associated with efforts to increase productivity, reorganise labour, reduce costs and strengthen managerial authority and AI is being introduced within these same social relations. Employers can use it to monitor workers, analyse performance, automate administrative tasks and reorganise employment. In some cases, it may eliminate particular jobs; in others, it may intensify work or extend managerial surveillance.

The central questions are therefore not simply whether AI is intelligent or whether it produces useful answers: they concern who owns the technology, who decides how it is deployed, whose labour it replaces or intensifies, and who appropriates the resulting gains.

Trade unions need the capacity to investigate these systems rather than just respond to their consequences. An independently developed agent could help examine company accounts, compare management statements with published financial information, identify changes in staffing patterns or organise evidence concerning workplace conditions. Such tools would not replace collective bargaining or industrial action: their value would lie in strengthening the information available to workers and their representatives.

AI is often presented as an immaterial technology operating somewhere in the cloud. In reality, it depends on extensive physical infrastructure: data centres, semiconductor manufacturing, electricity networks, cooling systems, telecommunications, mineral extraction and human labour.

Training and operating large AI models require substantial computing resources, particularly graphics processing units (GPUs). These contain billions of transistors performing calculations at enormous speeds. As the transistors repeatedly switch on and off, some electrical energy is converted into heat, creating substantial cooling requirements. The environmental consequences depend on the scale of operations, energy sources, cooling technologies and geographical location. The expansion of hyperscale data centres therefore raises important questions about electricity consumption, water use, land allocation and public investment.

The controversy surrounding Google’s proposed data centre at Kronstorf in Upper Austria illustrates the conflict between technological development, capitalist ownership and working class interests. The Austrian revolutionary socialist organisation Gruppe KLASSENKAMPF (GKK), publisher of the newspaper KLASSENKAMPF (Class Struggle), has criticised both the project and the response of the Austrian trade union movement.

In its article of August 23, ‘Storming the digital fortresses of capital’, GKK highlights the material demands of AI infrastructure. Google’s site covers approximately 50 hectares, while a possible expansion could require up to 4.4 terawatt-hours of electricity annually - nearly a third of Upper Austria’s total consumption of about 14 TWh in 2024.

For GKK, however, the central issue is not technology itself, but its ownership and control. In Google Data Centre Kronstorf (August 25), under the headings, ‘Water. Land. Energy’ and ‘Who decides?’, the organisation argues that “the problem is not digital technology”, but its subordination to private profit. Rejecting any return to a pre-digital society, it insists that the benefits of digitalisation should be available to everyone.

This argument is developed further in the October issue of KLASSENKAMPF. Its central article, ‘The ÖGB is a fighting organisation? Then fight!’, challenges the Austrian Trade Union Federation (ÖGB) for identifying workers’ interests with the competitiveness of Austrian capitalism. Rather than welcoming investment simply because it promises jobs, unions should question who benefits, who bears the costs and who exercises control. GKK consequently calls for union mobilisation against the Kronstorf project, alongside social ownership and democratic, working class control of digital infrastructure.

These arguments deserve serious consideration. Nevertheless, opposition to a data centre, however justified, does not itself equip workers with the technical knowledge necessary to understand and control AI. This requires the capacity to investigate algorithmic management, analyse workplace data, understand large language models and develop independent technological systems.

Political opposition and practical knowledge of technology must therefore go hand in hand. Democratic control means more than simply owning the technology: workers also need the knowledge, skills and organisations to decide how it is developed and used. The left must take AI seriously, learning how to use and develop tools such as open-source software, open-weight models, data analysis and retrieval-augmented generation, rather than leaving this work to big technology companies and their experts.

The Austrian comrades are right to ask who owns and controls digital technology. But changing ownership is not enough. Workers must also build the technical skills, political organisations and shared knowledge needed to understand AI, shape its development and bring it under real democratic control.

Hallucinations

In the CPGB aggregate discussion, Mike Macnair gave an example of an AI tool producing a confident, but inaccurate, answer about a historical record. He used it to show that AI outputs cannot be taken at face value. They need to be checked against reliable sources and evaluated critically, especially where accuracy matters.

My reply relied on a quote from Geoffrey Hinton, who argues that hallucinations (which he prefers to call “confabulations”) actually show how close AI has come to human cognition, because people do the same thing. His example is the Watergate scandal. When John Dean, Richard Nixon’s White House counsel, testified about meetings in the Oval Office, he recalled many details incorrectly, while sincerely believing them. Later comparison with the White House tapes showed that he had the overall gist right, but had reconstructed specifics that never happened.

Hinton’s point is that human memory does not retrieve stored facts the way a file system does: it rebuilds plausible accounts, and large language models work in a similar way. On this view, hallucination is less a bizarre machine fault than a familiar feature of how both brains and neural networks produce answers.

Instead of relying only on what a model absorbed during training, these systems first pull relevant information from a defined, trusted source, such as an organisation’s documents, a database or a curated knowledge base. They then base their responses on that material. This reduces hallucinations and makes outputs easier to trace and check. These systems work best when they have: