Collaborative Filtering for Mobile App Recommendations

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Collaborative Filtering for Mobile App Recommendations
Complex
~2-4 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    745
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1162
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

Introduction

Imagine: you have 500,000 users, a catalog of 100,000 products, but the conversion on recommendations is only 2%. The reason? Standard popular items are not personalized. We solve this with collaborative filtering (CF), which analyzes the user×item interaction matrix and delivers personalized results. No product information is needed—only behavioral signals. That's why CF works where Content-Based falls short: in recommendations for clothing, books, content with unstructured metadata. According to Amazon research, implementing CF increases sales by 20–30% in the first months. Our implementation experience shows that proper weight tuning and A/B testing can achieve a stable CTR increase of 30–50%.

Collaborative Filtering: Technical Core and Main Challenges

Matrix Factorization as the Foundation

Classic CF via dot-product nearest neighbor search doesn't scale beyond 100K users. The working approach is to decompose the interaction matrix into two embedding spaces: users and items are represented as fixed-dimension vectors (usually 64–256). The recommendation is finding items whose embeddings are closest to the user's embedding.

Libraries for training: Implicit (Python, specialized for implicit feedback), LightFM (hybrid CF+content), RecBole (research framework with 70+ algorithms). For production deployment, we usually choose Implicit + FAISS for ANN search. In terms of speed, Implicit is 3x faster than LightFM on sparse matrices.

Library Data Type Training Speed Flexibility Production Readiness
Implicit Implicit/Explicit ★★★★★ ★★★ ★★★★★
LightFM Hybrid ★★★★ ★★★★★ ★★★★
RecBole Research ★★★ ★★★★ ★★★

How Does Collaborative Filtering Solve the Cold Start Problem?

A new user with no interaction history is a typical cold start. Standard solution: for the first 5–10 interactions, we use a "popular items from the category of interest" rule (onboarding flow with preference selection). After accumulating minimal history, we switch to the personalized model.

In code, this looks like a strategy pattern:

// Android: recommendation strategy based on interaction count
interface RecommendationStrategy {
    suspend fun getRecommendations(userId: String, count: Int): List<Product>
}

class ColdStartStrategy(private val api: RecommendationApi) : RecommendationStrategy {
    override suspend fun getRecommendations(userId: String, count: Int) =
        api.getPopularByPreferences(userId, count)
}

class CFStrategy(private val api: RecommendationApi) : RecommendationStrategy {
    override suspend fun getRecommendations(userId: String, count: Int) =
        api.getPersonalized(userId, count)
}

class RecommendationRepository(private val api: RecommendationApi) {
    suspend fun getRecommendations(user: User): List<Product> {
        val strategy = if (user.interactionCount < 10) {
            ColdStartStrategy(api)
        } else {
            CFStrategy(api)
        }
        return strategy.getRecommendations(user.id, count = 20)
    }
}

Why Is Implicit Feedback Better Than Explicit?

In most mobile apps, users don't rate items. Implicit feedback—views, clicks, add-to-cart, time spent on product card—is much more informative but requires proper weighting: a view without a click ≠ interest, a click without a purchase ≠ satisfaction.

The weight scheme we use in practice:

Action Weight
View card > 3 seconds 1
Click "details" 3
Add to favorites 5
Add to cart 7
Purchase 10
Return -5

CF with proper weights gives a CTR increase of 30–50% compared to Content-Based, given sufficient data. In one project for a clothing retailer, we implemented Implicit ALS with the above weights. After 2 weeks of A/B testing, CTR increased by 40%, and conversion to purchase by 15%. We guarantee that with your data, the result will be at least as good.

Client-Side Event Logging

The quality of CF directly depends on the completeness and accuracy of logging:

// iOS: tracking interactions with precise viewing time
class ProductInteractionTracker {
    private var viewStartTime: Date?
    private let analytics: AnalyticsService

    func trackViewStart(productId: String) {
        viewStartTime = Date()
    }

    func trackViewEnd(productId: String) {
        guard let start = viewStartTime else { return }
        let duration = Date().timeIntervalSince(start)

        if duration > 3.0 {
            analytics.log(InteractionEvent(
                productId: productId,
                type: .view,
                weight: min(Int(duration / 3), 3),
                timestamp: start
            ))
        }
        viewStartTime = nil
    }

    func trackAddToCart(productId: String) {
        analytics.log(InteractionEvent(productId: productId, type: .addToCart, weight: 7))
    }
}

Tracking view time via viewStartTime allows distinguishing accidental views from real interest. Without this signal, the interaction matrix becomes noisy.

Serving: FAISS for ANN Embedding Search

The trained model exports item embeddings into a FAISS index. On request for user recommendations: get their embedding → search K nearest items in FAISS → filter already purchased → return the list. Latency with 1M items: 5–15 ms on the server.

FAISS serving architecture The index is built offline after model training. For inference, we use a REST API (Ktor/Kotlin or Vapor/Swift). On each user request, the user embedding is computed on the fly or cached. The top-K search is performed using `IndexIVFFlat` with nprobe=10 for speed. Results are post-processed: already purchased items are removed, and business logic is applied (e.g., category diversity).

What the Work Includes

  • Data audit: interaction matrix size, sparsity, cold start presence.
  • Setup of event logging on iOS/Android clients, considering App Store Review Guidelines and Google Play Console.
  • Model training (Implicit ALS or LightFM) on historical data.
  • Development of recommendation API + FAISS serving using Ktor (Kotlin) or Vapor (Swift).
  • A/B testing: CF recommendations vs popular items → measuring CTR and conversion.
  • Documentation and team training.
  • Post-launch support, monitoring for data drift.

Timelines

MVP with Implicit ALS + basic serving: 2–3 weeks. Full system with event logging, cold start fallback, A/B testing, and monitoring: 6–8 weeks. The cost is calculated individually after a project audit. We have over 10 years of experience in mobile development, and we guarantee a transparent process with regular demos.

Boost your recommendation conversion — get a consultation from our engineer on configuring CF for your data. Order an audit of your interaction matrix — we'll assess the potential. Contact us to start the project.

Machine Learning in Mobile Apps: CoreML, TFLite, and On-Device Models

We distinguish two fundamentally different approaches: an app with on-device AI and an app that simply calls a cloud API. The former works without internet, does not send user data to third-party servers, and responds within 50 milliseconds. The latter depends on network latency and pricing plans. Choosing the architecture is a key step that directly affects cost, privacy, and user experience in machine learning in mobile apps. Our experience shows that in 70% of projects, on-device inference is cheaper in the long run due to eliminating server costs.

How to Choose Between CoreML and TFLite for On-Device Inference?

CoreML — Apple's native framework for running ML models on device. Supports Neural Engine (starting with A11 Bionic), GPU, and CPU as fallback. Models are converted to .mlmodel format via coremltools from PyTorch, ONNX, or TensorFlow. Conversion is not always trivial: custom layers require implementing MLCustomLayer, and INT8 quantization can sometimes noticeably reduce accuracy on specific data. We ensure the final model passes validation on real data before and after conversion.

TensorFlow Lite — cross-platform alternative for Android and Flutter. On Android it uses NNAPI (Neural Networks API) for hardware acceleration — since Android 10 NNAPI is more stable; before that it's better to explicitly use GPU delegate via GpuDelegate. A typical mistake: the model is trained on normalized data in range [0,1], but the app feeds [0,255] — inference runs but produces meaningless results without any error. We include an automatic input data validation module in the SDK.

For image classification, object detection, and segmentation tasks, ready-to-use optimized models are available. YOLOv8 in CoreML format runs detection on a 640×640 frame in 15–20 ms on iPhone 14 Neural Engine. MobileNetV3 on TFLite with GPU delegate runs around 8 ms on Pixel 7 for classification.

Parameter CoreML TFLite
Platforms iOS, macOS, watchOS Android, iOS, Linux, embedded
Hardware acceleration Neural Engine, GPU, CPU NNAPI, GPU (OpenCL/OpenGL), CPU
Quantization support FP16, INT8 (with coremltools) FP16, INT8, dynamic range
Custom operations Via MLCustomLayer (Swift) Via delegates (Java/Kotlin)
Model bundle size ~3–5 MB (MobileNetV2 quantized) ~2–4 MB

What If You Need Text Generation On-Device?

Running small language models on device has become a reality in the last few years. Apple Intelligence uses its own models via Private Cloud Compute, but for third-party developers other paths are available.

llama.cpp with Metal backend on iOS is a working approach for phi-3-mini (3.8B parameters, 4-bit quantization, ~2.3 GB). Inference: 15–25 tokens/second on iPhone 15 Pro. For integration in Swift, use the Swift Package llama.swift or a wrapper via C interface llama.h. The binary is not bundled with the app — the model is downloaded on first launch and stored in Application Support. Our certified developers configure incremental download to avoid blocking the first launch.

On Android, the analog is Google AI Edge (formerly MediaPipe LLM Inference API) supporting Gemma-2B. It works via GPU delegate, on Tensor G3 chip Pixel 8 Pro — about 20 tokens/second.

Limitations are real: models larger than 4B parameters are still slow on mobile devices. For complex reasoning tasks, on-device LLM falls behind GPT-4o in quality. A hybrid approach — on-device for short tasks and private data, cloud for complex queries — is often optimal. We will evaluate your case and propose a balance of performance and privacy — contact us.

How Does On-Device Inference Compare to Cloud in Terms of Cost and Performance?

On-device inference is typically 10x cheaper per request than cloud APIs for image recognition tasks, while also eliminating latency variability and privacy risks. The table below summarizes the trade-offs.

Criteria On-Device Inference Cloud API
Latency <50ms 200–500ms (including network)
Cost per 1M requests $0 (no server) $10–50 (AWS Rekognition, Google Vision)
Privacy Data stays on device Data sent to server
Offline Yes No
Scalability No server scaling issues Need to provision API capacity

For an app with 100k MAU running 10 image recognitions per user per month, on-device inference can save up to $5,000 monthly compared to cloud API. Get a free consultation on your ML architecture today.

Integrating OpenAI API and Other Cloud Models

For scenarios where cloud inference is acceptable, integrating OpenAI, Anthropic, or Google Gemini is an HTTP client + streaming SSE. In Swift, AsyncThrowingStream is convenient for streaming responses. In Kotlin, use Flow.

Critically: API keys must never be stored in the app bundle. Even an obfuscated key can be extracted from the IPA in 10 minutes using strings or frida. Correct architecture: mobile app → your own backend → OpenAI API. The backend controls rate limiting, logs requests, and protects the key.

What Is Included in the Work (Deliverables)

  • Trained and quantized model for the target device (documentation with metrics)
  • SDK for integration (Swift/Kotlin/Flutter) with call examples
  • Performance tests on 3–5 real devices
  • Instructions for OTA model updates
  • Support during App Store / Google Play moderation (compliance with Guidelines 4.2, 5.1)
  • 2 weeks of technical support after release

Typical Project Pipeline

  1. Task analysis — measure latency, privacy, size, supported devices.
  2. Model prototyping — in Python, evaluate accuracy on target data.
  3. Conversion and quantization — for CoreML/TFLite with validation.
  4. Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
  5. Testing — on real devices, measure FPS, RAM, battery.
  6. Deployment — via TestFlight / Firebase App Distribution, monitor metrics.

Timelines: integration of a ready CoreML/TFLite model — 1–2 weeks, development of a custom model with mobile optimization — from 6 weeks, on-device LLM chat with personalization — 4–8 weeks.

Why We Take on Complex Cases?

10+ years of experience in mobile development, 50+ implemented AI/ML solutions, guarantee of compatibility with current iOS and Android versions. All projects undergo code review and load testing. The cost includes preparation of moderation documentation and training of your team.

Contact us — we will help you choose the architecture and implement ML in your app turnkey. Order an audit of your existing solution — we will assess the potential for server cost savings free of charge. In some projects, savings can reach significant amounts per month.