Home and Legal Correspondent
We've all seen the movie.
The dodgy witness is getting away with it until the wily lawyer mauls their evidence in the witness box, thanks to long nights preparing for just that moment.
There are tears of joy and a judge banging a gavel (only in American courts, mind). The post-script tells us that the case made the world a better place.
Not so fast.
Every day there are legal battles that the little man or woman loses. And very often they lose because they can't cannot afford to fight their corner against a wealthier opponent.
This is where artificial intelligence, the most talked-about subject of the last two years, could transform justice and fairness in society.
The legal world is agog with excitement about what AI is doing to the law.
Systems are being devised to not only carry out basic work, like contract-writing, but also to analyse thousands of pages of evidence in the most complex of cases.
And this revolution isn't just happening in the skyscrapers of global law firms, but quietly in places like the Westway Trust's Cost of Living Crisis Clinic in London.
This advice clinic in London helps clients in one of the poorest neighbourhoods in England deal with a raft of complicated disputes - from benefits appeals to disputes with landlords.
One client tells the BBC how she has been made homeless because the landlord cancelled her tenancy.
"I'm a professional person - and I am not used to finding myself in this kind of situation," she says.
"It's distressing, destabilising and being homeless, also at my age, is quite difficult."
There is legal aid for the absolute poorest in society - but it is means-tested and extremely limited. Many people give up on their fight against something they instinctively know has been an injustice.
So what's this got to do with artificial intelligence? Going to court can be cripplingly expensive. The aim of anyone sensible is to get a resolution long before that point. And that requires expert advice.
Adam Samji is a paralegal adviser at the Westway. He helps to prepare a case by researching whether a client has a point worth fighting against, say, a rogue landlord or government rejection of a benefits application.
An eligibility assessment for benefits can run to 60 pages. Each individual case can take hours of careful analysis of personal circumstances.
The Westway is now using AI tools to cut through these kinds of documents to the key facts and legal issues that could make or break a case.
"We spend a couple of minutes going through [the documents] and redacting the client's personal information," says Mr Samji.
"We upload it on to an AI model and that will give us all that information. It'll usually shoot it back in about 10 to 15 minutes.
"It will save us hours of having to do it ourselves. We can efficiently use our time, as their paralegal volunteers, to better serve our clients."
Revolution unfolding
This is a revolution. AI is beginning to fill what many regard as a fairness gap in the justice system.
Sir Geoffrey Vos, the Master of the Rolls, is the head of civil justice in England and Wales. He leads the judiciary's thinking on how far AI could go and has written the UK's first guidance on how it should be used in court.
"When people have claims, which they can't resolve, it creates a huge economic loss to our society," says Sir Geoffrey.
"They worry about the claim. They're not as productive in their jobs. We in the justice system really do want to find ways in which we can resolve people's problems more quickly, and at lower cost.
"Artificial intelligence in time will be one of those tools."
So how far could this AI revolution go?
Stephen Dowling is a barrister who also runs Trialview, one of many companies competing for a slice of the legal AI market that is predicted by the global research group Gartner, external to explode in the next two years.
His tool aims in real time to analyse a transcript of what witnesses are saying in court and compare that with other evidence in the case. If it spots something it thinks is inconsistent or wrong, the tool flags it. That traditionally is the job of the barrister.
But for every lead barrister in court, particularly in complex hearings, such as commercial fraud, there can be a vast supporting team in the wings.
"The technologies we're looking at will enable one lawyer, two lawyers to do the job of 10 or 20," predicts Mr Dowling.
"It's going to massively change access to justice and massively reduce down legal costs.
"People need, ultimately, human judges to hear what they're saying and to emotionally connect to what's involved. But all that can be assisted and augmented by the use of artificial intelligence."
The human factor
And it's that human factor that the legal world is now wrestling with because the potential downsides are obvious.
In 2023 a New York court fined lawyers who submitted bogus arguments that had been derived from questions they had put into ChatGPT.
The EU has recently introduced rules to try to ensure that AI is accurate and therefore that means its output needs to be checked by real people. That's a practical risk that the Westway Trust's team is well aware of.
"At the moment, about one in 30 occasions it's not accurate," says John Mahoney, a lawyer at the organisation.
"So we're having to check all of the work that we produce through AI that relates to giving legal opinions."
Has that human check been written into Sir Geoffrey's rules?
"Ultimately, the rule of law requires that individuals have access to an independent judge to decide their case," says the top judge.
"If you're using a technological tool, the parties must know that's happening.
"Judges are being assisted by technological tools. We have been for years. You obviously are talking about Robo-judges. But I think we're a long way from that."
His guidance underlines that not only must lawyers remain responsible for the evidence they put before a court, but judges must be also on guard against biased results from AI tools trained on partial data.
When we fired legal questions at ChatGPT to see how it would respond, it gave some pretty simple advice relating to both getting out of a contract and resolving a legal row with an ex partner over ownership of kitchen pans.
It declined to advise our fictional bank robber how he could beat the charge:
Fun while that may have been, Sir Geoffrey warns against the public seeking advice from generic AI tools which have not been trained on professional legal databases.
"It won't distinguish between English law, Australian law, Singapore law and probably US law," he warns.
But he adds: "I'm very confident that technology will not stand still.
"The rule of law depends on being able to provide outcomes from an independent judiciary. And it's very difficult for the small number of judges to do that in this country when you've got 60 million people without using technological tools to good effect."