
Operation Serenata de Amor – An AI project to analyze public spending in Brazil - dorfsmay
https://en.wikipedia.org/wiki/Operation_Serenata_de_Amor
======
dorfsmay
This project is using AI to analyse public data of receipts from elected
government officials, detect anomalies and tweet about them. It has already
led to a deputy to have to return funds to the government.

There is very little material in English about this project, I finally spent
some time to translate and create an English and French wikipedia page. I am
not otherwise involved with this project (yet!) but think it deserve more
visibility, and that we should leverage it and similar project in other
countries.

~~~
DavidHm
How is this project perceived by the government officials?

I am sure (or at least hope) that some of them are very much in favour, but
are there others calling into question the accuracy / legitimacy of these type
of analyses?

~~~
kuresto
(Brazilian here with bad english) There isn't much interest yet. But that is
expected.

Information flows somewhat like this here: First they ignore it hard, then
media comes and make a fuss and that makes the gov. officials respond with
disdain or support (depends on the strategy they adopt). But if it gets hotter
something bigger magically happens to distract public opinion.

At least it is already on dados.gov.br, which is the brazilian portal for open
data, meaning at least received some support from groups inside the
government. But almost no interest from conventional media.

~~~
tytytytytytytyt
Wow, I wish my Portuguese was that bad.

------
diego_moita
Disclaimer: I am a former Brazilian. I am what in Brazil is called in
pejorative terms "vira-lata" (stray dog), someone that fell out of love for
his native country. Because a lot of people in this thread are patriotic
Brazilians I anticipate a lot of downvotes.

This project is nothing more than a sharper and better diagnosis of topical
symptoms. Unfortunately, the underlying disease remains without treatment. And
if you allow me to explain such disease bluntly, here it is: the Brazilian
voter is astonishingly stupid. Brazilians vote very, very badly. Politicians
with a long and explicit history of corruption are routinely re-elected and
remain very popular (e.g: Maluf, Sarney, Calheiros, Collor, Lula and almost
everyone in the 3 big parties: PMDB, PSDB and PT).

There is even a standard justification for this behaviour, people say "rouba
mas faz" (he steals but gets things done).

Like in most of the 3rd world and countries with authoritarian history, the
overwhelming majority of the Brazilian voters don't understand how corruption,
nepotism, patronage and incompetence affects them. I bet Turkey, Russia,
Poland and Hungary are the same. Democracy goes far beyond the formal
institutions, you need a civic heart, a belief within every citizen's mind
that the public good matters a lot and affects everyone. In most 3rd world
countries people just don't "get" this.

~~~
ionforce
Pode explicar a tradução ou conexão para as palavras, vira e lita. Não
significam "look" e "can"?

Não sou brasileiro.

~~~
random42_
Like the others already explained, "vira-latas" is a portuguese term for a
stray dog and the idea that they need to flip trash cans to try to find food.

However, there is also an expression (whose origin was also explained) that
means _" Mongrel complex (Complexo de vira-Lata in Portuguese), which is an
expression used to refer to a collective inferiority complex felt by some
Brazilian people in comparison to Europe or the United States."_[0]

Contrary to what was said here, the term coined by Nelson Rodrigues was not
exclusive related to soccer. According to him: "By "Mongrel Complex" I mean
the inferiority in which Brazilians put themselves, voluntarily, in comparison
to the rest of the world. Brazilians are the reverse Narcissus, who spit in
their own image. Here is the truth: we can't find personal or historical
pretexts for self-esteem."[0]

[0] -
[https://en.wikipedia.org/wiki/Mongrel_complex](https://en.wikipedia.org/wiki/Mongrel_complex)

~~~
triangleman
Interesting concept, the "reverse Narcissus", especially in this case. Because
you see, in the same breath as they complain about their country, Brazilians
will tell you that "God is a Brazilian".

Perhaps jingoism and mongrelism are two sides of the same coin. It would
certainly explain how Trump got elected after a campaign based on complaining
about his own country.

~~~
random42_
It's an interesting fact--anecdotally, of course--that as much as they
complain about the country, they won't let anyone from outside to do the same
thing.

------
soroso
Serenata de Amor is a brazilian candy:
[https://hibrazilmarket.com/products/garoto-serenata-de-
amor-...](https://hibrazilmarket.com/products/garoto-serenata-de-amor-19g-1)

From their faq: [https://serenata.ai/en/faq/](https://serenata.ai/en/faq/)

1 - We were inspired by the Toblerone Affair, a case in which a Swedish
politician was pushed to resign after being caught paying simple Toblerone
chocolate bar with public money. That’s what we want to do: empower social
control of public expenditures including values as low as a chocolate bar.

------
wallflower
On the topic of corruption, my Spanish teacher said that countries where
corruption is endemic and part of the culture almost always started out as
"extraction colonies". That is, the natural resources were plundered by the
colonizers (the Spaniards or the British or the French). What present day
politicians are doing is simply continuing the strong historical precedent of
taking out riches/prosperity/profits/resources from the country for their own
use.

In Haiti, Jean-Jacques Dessalines, the leader of the slave rebellion who
overthrew the colonizers rapidly became one of the "1%" and a de-facto
colonizer once he gained power and they realized that slavery and plantations
and serfdom was quite lucrative and profitable.

[https://en.wikipedia.org/wiki/Jean-
Jacques_Dessalines](https://en.wikipedia.org/wiki/Jean-Jacques_Dessalines)

~~~
dashoffset
> countries where corruption is endemic and part of the culture almost always
> started out as "extraction colonies".

This is an overly simplified, albeit correct, way to explain it.

~~~
wallflower
In case you see this, can you please point me to any resources /books on a
non-overly simplified way to explain the roots of corruption in Latin American
countries?

~~~
dashoffset
I would start with "The causes of corruption" by Daniel Treisman. It isn't
specific to Latin America, though.

In summary, Treisman will show that many factors appear to have an influence
on whether a country is more or less corrupt. The colonial past of Latin
American countries helps to explain part of it, but it doesn't appear to be a
causa sine qua non.

~~~
wallflower
Thank you! I have started reading the paper, and it is interesting to read how
the author lays out his hypotheses.

Most intriguing is the link between how judicial systems that were setup to
support the king may tend to be more corrupt since they were literally robbing
property/money from his subjects. On the other side, the British system relies
on judicial precedents and process, helping ensure a more fair trial between
the government and property owners/business people.

[https://www.amherst.edu/media/view/131389/original/Treisman2...](https://www.amherst.edu/media/view/131389/original/Treisman2000.pdf)

------
motohagiography
Slight unintended consequence is it creates a significant incentive for
politicians to allow their expenses to be picked up by someone else. There are
rules in many democracies where "gifts," over small amounts (~$50) must be
reported to ethics commissions and scrutinized for opportunity by the
opposition, media, and by extension, the public.

In a simple risk game of likelihood vs. consequences, expensing a meal in an
upper end restaurant will %90 draw political consequences from an AI, with a
high degree of uncertainty in the cost to fight it, vs. accepting the hosts
generosity, with a sub-%5 chance of consequences occurring like having to pay
your share, or a minor sanction some years into the future.

I'd argue most politicians necessarily make risk and cost/benefit calculations
before ethical signalling ones, and the indiscriminate application of rules in
this case creates inverted incentives that demoralize the situation, and will
cause them to start accepting insignificant bribes.

The economic value of "AI" is mostly to obfuscate and symbolically defray the
chain of individual human accountability. While this may be working for the
"good guys," in the public interest, it's really about protecting the people
who are using what is essentially a Bayesian black box as an ethical proxy for
their personal interest. It's fascinating and cool, but it's also a bit
disingenuous to accept magical pretexts and other ethical proxies because we
perceive them to be "on our side."

~~~
SiempreViernes
I don't get most of the argument here, what are you trying to say?

Politicians are already incentivised to get their bribes indirectly, that's a
natural consequence of doing something illegal while expecting to have your
actions recorded. But beyond that I don't understand, are you saying that
because the AI allows for such efficient oversight that politicians will be
unable to hide large bribes and be _forced_ to accept "insignificant bribes"?
But even if the only effect is that corruption is much cheaper, what is the
downside to that? At least more people can afford it then.

> it's really about protecting the people who are using what is essentially a
> Bayesian black box as an ethical proxy for their personal interest

How is fighting corruption best described by "personal interest"? The only way
I can make sense of this is of you hold the belief that rule of law is not
fundamental for a just society, and the circumvention of the law that
corruption represents somehow makes societies more just.

~~~
motohagiography
That seems like an uncharitable interpretation.

What I have said is that this particular AI approach changes the risks and
incentives for politicians so that they are _more_ likely to commit a greater
number of small, but more real offenses, than the few outward anomalies the AI
flags.

Which is worse? Expensing a bottle of wine, or having a vendor pick up the tab
for an entire meeting? I would argue the latter has more impact on perceptions
of corruption, yet this demoralized AI approach disproportionately punishes
the former.

There is a style of argument that I'm starting to think of as "argument from
tyranny," which begins with a denial of the coherence and legitimacy of the
speaker, and ends with a defamation of character. They call it "sealioning,"
on the internets, but it bears more scrutiny, because it is part of why people
are reduced to using pseudonyms.

------
dovyski
This is such a cool project that deserves some attention.

As a side note: one of the project members was interviewed on The
Changelog[0]. The interview presents many topics related to the project, e.g.
technology, community, challenges.

[0] [https://changelog.com/podcast/268](https://changelog.com/podcast/268)

~~~
dorfsmay
Thanks. I was was actually about to post this. Fábio Rehm gives a really good
overview of the project in that podcast. This is how I actually discovered
that project.

~~~
fgrehm
Oh, It wasn't me :) I just suggested the podcast and Eduardo Cuducos
(@cuducos) talked about it there =}

~~~
dorfsmay
Oh! I discovered it from one of your tweet / blog! Thanks for the correction.

------
personlurking
Slightly off-topic, but this is what a Serenata de Amor is in Brazil (it's a
bonbon and it's very good, IMHO):
[https://i.imgur.com/tQZ0JHF.jpg](https://i.imgur.com/tQZ0JHF.jpg)

~~~
oblio
I assume it's also "love song" (well, "love serenade", to be a bit more
accurate) :)

~~~
csjr
You are correct! [https://serenata.ai/en/faq/](https://serenata.ai/en/faq/)

------
gomox
I love the idea, but a quick review of tweets shows a bunch of seemingly
inconsequential reports for meal refunds where the issue is that the meal
price is an outlier, but prices listed are 39 to 75 BRL (12-25 USD).

That doesn't strike me as a funny meal price. Assuming it's not an error, it
would be nice to have some additional context on what the observed
distribution of meal prices is, because at a cursory glance this looks like
noise.

Is someone able to find a more substantial report?

~~~
lenilsonjr
Take this one, for instance:
[https://jarbas.serenata.ai/layers/#/documentId/6185347](https://jarbas.serenata.ai/layers/#/documentId/6185347)

R$239.50 or $74. That's 25% the minimum wage here in Brazil.

This means that this congressman was paying for someone else's meal, which is
in itself an act of corruption.

And even if that's not the case, most Brazilians can't afford a 40 BRL meal on
a regular basis, so why should a politician be able to do so with our money?

If you dig deeper into other reports, you can also see congresspeople spending
public money in sex shops and clubs, for instance
([https://twitter.com/cuducos/status/840882495868530688](https://twitter.com/cuducos/status/840882495868530688)).

~~~
gomox
I think there are two separate issues.

I don't know whether paying for someone else's lunch is OK according to
regulations for meal stipends in Brazil. I wouldn't call that corruption off
hand, but it might be forbidden. I defer to you on this.

Personally I live in Buenos Aires and I regularly spend USD 15 on a no frills
lunch menu in a fancy-ish neighborhood (nothing fancy for the food itself, no
desert, the kind of place where a group of 20 people from nearby offices have
a loud lunch). From my experience Sao Paulo is more expensive than Buenos
Aires, so it didn't strike me as odd initially.

That's out of reach for the statistical average of income from Argentineans,
but it's not an amount that a congressman wouldn't be able to afford on their
own dime. I certainly wouldn't get outraged at the expense or assume
corruption - congressmen are paid significantly above minimum wage.

~~~
badosu
40 BRL can pay a lunch in a very good restaurant, maybe not the commoner's bit
understandable.

100 BRL would pay a buffet in a fancy barbecue shop, the absolute limit for
me.

200 BRL+ is completely unnaceptable. Do they want to eat at a bistreau with
public money?

------
lbrito
Interesting project, but the false positives might turn people off. Stuff like
a 50 BRL (~15 USD) pizza receipt
([https://jarbas.serenata.ai/layers/#/documentId/5611260](https://jarbas.serenata.ai/layers/#/documentId/5611260))
are not that interesting in a country with much more lavish public spenders.

Namely, I'd like to see more public scrutiny against the illegal salaries
judges receive in Brazil - which sometimes are twice or three times greater
than the legal limit.

~~~
notahacker
Yeah, as well intentioned as it is, the real corruption is people taking huge
backhanders for stuff, and diverting government funds to their family, not
people forgetting to name the members of staff they had lunch with on
paperwork, getting the date wrong on the paperwork or buying stuff in both the
origin city and destination city of their flights. And the real corruption
generally doesn't involve expense receipts

The UK had a similar issue which started off with looking at very specific
instances where politicians made hundreds of thousands of pounds from
fraudulent representations for expenses associated with a London "second home"
and ended up ranking MPs by office expenses they were very much entitled to
claim and highlighting legitimate claims for snacks just because they were
funny. Trouble is, the basic conclusion was "all MPs are corrupt" which
actually makes it harder to grab public attention over more serious conflicts
of interest.

------
amarant
this is awesome! having lived in Brazil I can testify that the country really
need this (if such testimony is necessary). However I do think other countries
would benefit too!

I've long wished for AI governance, and this is a great step in the direction
I imagine that working. I for one welcome our new robot overlords ;)

~~~
andrepd
>I've long wished for AI governance

Someone has to write the algorithms, and something tells me it's not going to
be the 99%.

~~~
zaarn
It probably wouldn't end in a Skynet-type situation. Or rather, that is very
very unlikely.

Though on the remote possibility that this does happen; I welcome our new AI
overlords!

------
unbearded
In Brazil, federal, state and some local governments publish what is called
"Diário Oficial". It's a daily ledger of official hirings, firings, payments,
votes on legislative chambers and even criminal indictments. The Brazilian
Congress also post all the laws and amendments proposed and approved on its
website [http://www2.camara.leg.br/](http://www2.camara.leg.br/).

While AI is no solution for corruption, it could create a more transparent
system with a lot more accountability highlighting the potential misuse of
money.

Actually, even without sophisticated technology, whoever decides to read the
free and available content, will quickly find many things that jump the eyes.
For instance, I remember seeing that my city, under the new mayor, was paying
for school buses while the school was off, in the month of January and three
times the amount the previous administration used to pay (while kids were in
school). My city also had even a helicopter for the local security force,
which was not actually police and was not able to even carry guns. The
helicopter was paid, faithfull, for many years. But seen in public only once,
in a parade.

At the time (many years ago), I tipped newspapers and nobody cared.

A few years ago I created a simple script that to download all the public
available law proposals from the Congress
([https://github.com/pablomelo/baixa_camara](https://github.com/pablomelo/baixa_camara))
and downloaded 300GB of data.

I wanted to create an app where voters could see where and what was the
allegiance of their representatives (In Brazil there's no district division
and a candidate for Congress can get votes from anywhere in the state. While
it prevent's gerrymandering, it also allows politicians to have little
commitment to their constituents).

------
coliveira
This project is interesting, but real corruption doesn't happen with receipts.
Corrupt politicians will receive funds in offshore accounts and then work for
foreigners, such as the foreign oil companies that are now taking vast amounts
of Brazilian oil contracts for next to nothing. The corruption cases presented
by the Brazilian media are peanuts compared to these shady deals involving big
foreign investments.

~~~
epx
This is the excuse of the impeached Workers Party ex-government. With a touch
of fascism - "the foreigners are the real danger!!!!!11111".

The other excuse was that "corruption is small compared to the GDP". (And what
about the chilling effects?)

~~~
coliveira
If you don't believe that Shell/BP can buy politicians to have easy access to
oil, you should better get acquainted with the politics of other countries
[0]. This is the first thing I thought about when I heard about big oil
reserves in Brazil.

[0]
[https://www.ft.com/content/a9e193de-2044-11e7-a454-ab0442897...](https://www.ft.com/content/a9e193de-2044-11e7-a454-ab04428977f9)

~~~
epx
I am not naive, and you should not be naive to the "bad bad foreigners" mantra
that is tailored for the reptilian brain layer of the voters, either.

~~~
badosu
Dude, this hapoens and is not as negligible as you imply.

Sure, there's an agenda to appeal for a certain rhetoric, but you must accept
some facts.

------
vit05
Some people are missing the point. The project does not have the idea of
seeking congressmen who spend a lot on their meals. Of course, that could help
them spend a little less.

But the idea is to find irregularities. That is, a congressman who says he had
lunch at such a restaurant, but by analyzing the invoice and the address we
find that this restaurant never existed. Or a gas station that does not really
work anymore.

This is very common. It is not an analysis of what they do with their wages.
These congressmen receive compensation beyond their wages to spend when
working in their regions. This compensation has a value of four to five times
more than their salary.

------
JackuB
Slightly OT but combination of gov and data kind of reminded me of Project
Cybersyn. If you like this project, you might find reading about Cybersyn
interesting [http://www.newyorker.com/magazine/2014/10/13/planning-
machin...](http://www.newyorker.com/magazine/2014/10/13/planning-machine)

~~~
finnh
Also:

[https://99percentinvisible.org/episode/project-
cybersyn/](https://99percentinvisible.org/episode/project-cybersyn/)

------
vadimberman
Very interesting.

I heard of Benford's law
([https://en.wikipedia.org/wiki/Benford%27s_law#Accounting_fra...](https://en.wikipedia.org/wiki/Benford%27s_law#Accounting_fraud_detection))
that is used to detect accounting fraud.

Are there other known mathematical models to detect fraud?

------
ggambetta
FWIW, it is named after an immensely popular bonbon from Brazil:
[https://www.garoto.com.br/produtos/detalhes/191](https://www.garoto.com.br/produtos/detalhes/191)

------
slededit
Why is a fishing expedition OK in this scenario but not in normal criminal
cases?

It's not a value judgement. I think it's an interesting question.

------
rambossa
the twitter account:
[https://twitter.com/RosieDaSerenata](https://twitter.com/RosieDaSerenata)

------
forinti
Brazil is currently overly excited with fighting corruption when its greatest
problems lie unperturbed.

Income is too concentrated, taxes are highly regressive, and half the federal
budget goes into servicing the debt.

All spheres of brazilian government have achieved a good level of
transparency. But the national debate is always skewed by the current scandal
cooked up by the media (that's another serious issue: the media is also too
concentrated).

~~~
pedro_hab
hmn, do you mean corruption is not as bad as income inequality?

Because one can argue that corruption foster inequality, where government
workers steal money from the people, they give favor to rich "friends" making
them richer.

I can guess your solution is to give more power to the state to solve the
inequality issue, which actually worsens the corruption caused inequality.

~~~
forinti
I don't think cutting corruption to zero would impact people's lives as much
as having a progressive tax system.

If you look at overall tax burden, the lowest tier pays close to 50%. The
highest tier, a bit over 25%. Trump tried to lower corporate tax to 15% and
not even his party thought it was reasonable. In Brazil, corporate tax is
zero.

One of the richest people in Brazil, Steinbruch, was caught trying to evade an
estate tax of only 4%, when food is taxed at near 20%.

~~~
cjalmeida
You're wrong. In Brazil corporate income is taxed at 34,5% (base 15%, plus
additional 10% for medium to big sized companies, plus 9,5% for social
security)

That amount is on par or above OCDE counties, and much higher than most
developing nations.

What we don't have is dividend tax. Unlike corporate tax that one must pay
every quarter, you only pay dividend tax if you give money back to
shareholders, so reinvestments are not taxed.

Usually countries balance income and dividend taxes so the government has a
stable income but doesn't penalize investments as much. In Brazil, we opted
for screwing investors.

Not to mention that companies pay an enormous amount of money in combined
sales taxes. A manufacturing company usually pays 17% for state sales tax,
another 9,35% federal social security, and sometimes an extra 5% to 15% for
"luxury good" (like shampoo).

So, again, you're completely wrong and companies (read YOU) pay a hell lot of
taxes in Brazil.

Source: I worked in investment analysis in another life.

~~~
pedro_hab
Idk much about corporate taxes in Brazil, but I do know that the poor pay way
too much, a minimum wage employee pays taxes and "contributions" and other
forms of taxations, such as FGTS and inflation.

And they pay again when buying goods, I was shocked when I read about the
welfare state and the welfare cliff in the US, for the propaganda I was
subjected in Brazil it was hard to believe.

So Brazil is way worse for the poor than the US, and getting paid in Brazil as
remote for me (as a dev) is cheaper, since I work as a contractor and would
pay between 4-6% taxes against ~25% in the US.

