Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
🇨🇦Canadian Tribunal Rejects Fabricated Case Law
In Canada a family couple relied on Microsoft Copilot to generate legal precedents in a condo dispute—only to discover that nine out of ten cited rulings didn’t exist. The Civil Resolution Tribunal found the cases to be AI “hallucinations,” raising serious concerns about the reliability of AI-generated legal research.
While AI can streamline legal work, this case underscores a fundamental risk: without proper verification, reliance on AI-generated case law can undermine legal arguments and credibility. .
#AI#LegalTech#AIEthics#Hallucinations
🇿🇦South Africa Withdraws AI Policy Over Hallucinated Sources
South Africa has withdrawn its draft national AI policy after discovering that at least 6 of its 67 academic citations were AI-generated and referred to non-existent journal articles. Communications Minister Solly Malatsi stated that the most plausible explanation is the inclusion of unverified AI-generated references, calling the lapse a failure that “compromised the integrity and credibility” of the policy.
The draft policy had proposed establishing a national AI commission, an AI ethics board, and a regulatory authority, alongside incentives such as tax breaks and grants to support AI infrastructure. The issue was identified after News24 found fabricated citations, later confirmed by journal editors. The policy will be revised before being reissued, and the minister indicated there would be consequences for those responsible.
The case highlights risks of using generative AI in policy drafting without verification. A Nature study cited in the report found that over 2.5% of academic papers in 2025 contained at least one potentially hallucinated reference, up from 0.3% in 2024, amounting to more than 110,000 papers.
#AIRegulation#AIethics#Hallucinations#PublicPolicy#AIGovernance
People who eat the mushroom Lanmaoa asiatica raw or undercooked have reported seeing tiny human-like figures moving around them.
These are called lilliputian hallucinations.
Reports from people across different cultures and backgrounds describe similar details, including small figures walking on floors and furniture.
The effects can begin 12–24 hours after eating and may last 1–3 days.
Some cases are serious and require hospital care.
Don't try this yourself..
🍄😵💫🧚♀🦄🍄🟫
[Read more 1]
[Read more 2]
[Read more 3]
@googlefactss
#Mushrooms#ScienceFacts#Hallucinations#Nature#DidYouKnow
If you have ideas or feedback contact us:
@Googlefactss_Feedback_bot
🔥WFGY 2.0 — Semantic Reasoning Engine for LLMs (MIT)
Это движок с открытым исходным кодом, цель которого — уменьшить галлюцинации и логические сбои в системах типа RAG / LLM, особенно когда:
- источники OCR-текста плохо распознаются,
- происходит «semantic drift» (когда ответ уходит от вопроса),
- «ghost matches», когда извлечённый фрагмент кажется релевантным, но на самом деле нет.
Обычно ошибки ловят уже в готовом сгенерированном тексте, из-за чего они часто повторяются.
В Semantic Reasoning Engine всё наоборот: если система видит, что рассуждения «кривые» или сбились с курса, она останавливается, сбрасывается или ищет другой путь и отвечает только когда состояние стабильно.
🛡Авторы называют это semantic firewall - семантический «файрвол».
Проверки встроены прямо в процесс мышления модели, а не поверх ответа с фильтрами или регексами. Это помогает избегать ошибок до того, как они попадут в вывод.
📌 Проект включает карту из 16 типичных ошибок LLM:
- неверный поиск данных,
- сбившаяся логика,
- «провалы памяти»,
- путаница ролей агентов и другие.
Для каждой есть простое текстовое исправление. Никаких SDK — достаточно вставить инструкции прямо в промпт.
🟢Как модель решает, правильные ли ответ генерируется:
- ΔS (drift) - не уходит ли смысл слишком далеко от шага к шагу
- λ (convergence) - сходится ли рассуждение к решению или крутится в цикле
- Coverage — достаточно ли фактов и аргументов учтено
Если все три условия выполнены, ответ считается «качественным».
🟢В тестах стабильность вывода выросла до 90–95% против обычных 70–85% у традиционных подходов.
▪Github: https://github.com/onestardao/WFGY
@ai_machinelearning_big_data
#ai#llm#opensource#reasoning#hallucinations#promptengineering